Example #1
0
        private void Start()
        {
            SetPauseMenuVisibility(false);

            continueButton.onClick.AddListener(() =>
            {
                Time.timeScale = 1f;
                OnContinueButtonPressed?.Invoke();
                SetPauseMenuVisibility(false);
            });

            pauseButton.onClick.AddListener(() =>
            {
                Time.timeScale = 0f;
                OnPauseButtonPressed?.Invoke();
                SetPauseMenuVisibility(true);
            });

            exitButton.onClick.AddListener(() =>
            {
                Time.timeScale = 1f;
                OnExitButtonPressed?.Invoke();
                StartCoroutine(sceneService.LoadSceneAsync(SceneType.Menu));
            });
        }
Example #2
0
 private void Awake()
 {
     my_PauseButton.onClick.AddListener(() =>
     {
         OnPauseButtonPressed?.Invoke();
     });
 }