Advertisement
Guest User

Untitled

a guest
Nov 21st, 2014
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. public class OrderArray : MonoBehaviour
  2. {
  3.  
  4. List<Order> orders;
  5.  
  6. public class Order
  7. {
  8. public string company{ get; set; }
  9. public string date{ get; set; }
  10. public int quantity{ get; set; }
  11. public string deliverdate{ get; set; }
  12. }
  13. void Start()
  14. {
  15. orders= new List<Order>();
  16.  
  17. orders.Add(new Order
  18. { company = "Woodpecker Corp",
  19. date = "21.11.2014",
  20. quantity= 250,
  21. deliverdate= "29.11.2014" });
  22.  
  23.  
  24.  
  25. // To access the Data in the list Im using:
  26. Order order1= orders[0];;
  27. Debug.Log(order1.company)
  28. }
  29.  
  30. public class menu : MonoBehaviour
  31. {
  32. OrderArray orderarray;
  33. Orderarray.Order orderclass;
  34.  
  35. void start()
  36. {
  37. orderarray= gameObject.GetComponent<OrderArray>();
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement