Advertisement
Guest User

Untitled

a guest
Nov 16th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. public class ActionObject : GameComponent
  2. {
  3. public static List<ActionObject> ActionObjects;
  4.  
  5. [SerializeField]
  6. protected int maxActionPoints;
  7. [SerializeField]
  8. protected int actionPoints;
  9. public bool canAct = true;
  10.  
  11. void OnEnable()
  12. {
  13. if(ActionObjects == null) ActionObjects = new List<ActionObject>();
  14. if(!ActionObjects.Contains(this)) ActionObjects.Add(this);
  15. }
  16.  
  17. void OnDisable()
  18. {
  19. if(ActionObjects.Contains(this)) ActionObjects.Remove(this);
  20. }
  21. }
  22.  
  23. public class TurnHandler : GameComponent
  24. {
  25. private int turnNumber = 0;
  26. private bool allMoved = false;
  27.  
  28. public void HowMany()
  29. {
  30. Debug.Log("Number of action objects: " + ActionObject.ActionObjects.Count);
  31. }
  32.  
  33. private void Start()
  34. {
  35. HowMany();
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement