Advertisement
Guest User

LvlData

a guest
Dec 13th, 2019
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.99 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. [System.Serializable]
  5. public class Order {
  6. public bool hasCheese = true;
  7. public bool hasTomato = false;
  8. public List<IngredientData> toppings;
  9. public int weight = 1;
  10. }
  11. [System.Serializable]
  12. public class CustomerData
  13. {
  14. public float basePatience;
  15. public List<Order> potentialOrders;
  16.  
  17. }
  18. [System.Serializable]
  19. public class Wave {
  20. public float basePatience = 40f;
  21. public List<Order> potentialOrders;
  22. public float timeToNextWave = 1f;
  23. public float customerSpawnInterval = 1f;
  24. public int normalCustomerCount;
  25. public List<CustomerData> startCustomers;
  26. public List<CustomerData> endCustomers;
  27. //[HideInInspector]
  28. public List<CustomerData> customers;
  29. public void GenerateCustomers()
  30. {
  31. customers = new List<CustomerData>();
  32. for(int i = 0; i < startCustomers.Count; i++)
  33. {
  34. customers.Add(startCustomers[i]);
  35. }
  36. for(int i = 0; i < normalCustomerCount; i++)
  37. {
  38. CustomerData customerData = new CustomerData();
  39. customerData.basePatience = this.basePatience;
  40. customerData.potentialOrders = new List<Order>(potentialOrders);
  41.  
  42. customers.Add(customerData);
  43. }
  44. for (int i = 0; i < endCustomers.Count; i++)
  45. {
  46. customers.Add(endCustomers[i]);
  47. }
  48. }
  49. }
  50.  
  51. [CreateAssetMenu(fileName = "Data", menuName = "ScriptableObjects/LevelData", order = 1)]
  52. public class LevelData : ScriptableObject
  53. {
  54.  
  55. public float scoreOneStar, scoreTwoStar, scoreThreeStar = 0f;
  56. // score stuff
  57. public List<Wave> waves;
  58. public int GetCustomerCount()
  59. {
  60. int count = 0;
  61.  
  62. foreach(Wave wave in waves)
  63. {
  64. count += wave.startCustomers.Count;
  65. count += wave.endCustomers.Count;
  66. count += wave.normalCustomerCount;
  67. }
  68.  
  69. return count;
  70. }
  71.  
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement