Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class GameUI : MonoBehaviour
- {
- public Text timeLabel;
- private bool isInitialized = false;
- void Start()
- {
- isInitialized = true;
- GameController.instance.OnGameInfoChanged += this.OnGameInfoChanged;
- }
- void OnEnable()
- {
- if (isInitialized)
- GameController.instance.OnGameInfoChanged += this.OnGameInfoChanged;
- }
- void OnDisable()
- {
- GameController.instance.OnGameInfoChanged -= this.OnGameInfoChanged;
- }
- void OnGameInfoChanged(GameType type)
- {
- //...
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement