LifeCheckerButton.cs 464 B

12345678910111213141516171819202122
  1. using UnityEngine;
  2. using System.Collections;
  3. using UnityEngine.UI;
  4. public class LifeCheckerButton : ButtonMenuTransitionEvent
  5. {
  6. private void Start()
  7. {
  8. GetComponent<Button>().onClick.AddListener(OnClick);
  9. }
  10. protected override void OnClick()
  11. {
  12. MenuManager._instance.ExitToMainMenu = false;
  13. if (LivesManager.Instance.CanPlay)
  14. {
  15. base.OnClick();
  16. } else
  17. {
  18. NotificationCenter.Post(NotificationType.TriedPlayingWithoutLivesLeft);
  19. }
  20. }
  21. }