Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. public class GameUI : MonoBehaviour
  2. {
  3. public Text timeLabel;
  4.  
  5. private bool isInitialized = false;
  6.  
  7. void Start()
  8. {
  9. isInitialized = true;
  10. GameController.instance.OnGameInfoChanged += this.OnGameInfoChanged;
  11. }
  12.  
  13. void OnEnable()
  14. {
  15. if (isInitialized)
  16. GameController.instance.OnGameInfoChanged += this.OnGameInfoChanged;
  17. }
  18.  
  19. void OnDisable()
  20. {
  21. GameController.instance.OnGameInfoChanged -= this.OnGameInfoChanged;
  22. }
  23.  
  24. void OnGameInfoChanged(GameType type)
  25. {
  26. //...
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement