Advertisement
Guest User

Untitled

a guest
Feb 7th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. using UnityEngine;
  2.  
  3. public class StrategyBase : MonoBehaviour
  4. {
  5. protected GameManager _manager;
  6.  
  7. public void Init(GameManager manager)
  8. {
  9. _manager = manager;
  10. enabled = false;
  11.  
  12. OnInit();
  13. }
  14.  
  15. public void Enter(StrategyType lastStrategy)
  16. {
  17. enabled = true;
  18.  
  19. OnEnter(lastStrategy);
  20. }
  21.  
  22. public void Leave()
  23. {
  24. enabled = false;
  25.  
  26. OnLeave();
  27. }
  28.  
  29. protected virtual void OnInit()
  30. {
  31.  
  32. }
  33.  
  34. protected virtual void OnEnter(StrategyType lastStrategy)
  35. {
  36.  
  37. }
  38.  
  39. protected virtual void OnLeave()
  40. {
  41.  
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement