示例#1
0
        private void SubscribeUIEvents()
        {
            retryOption.OnOptionSelected.AddListener(() =>
            {
                MoveSelector(retryOption.GetComponent <RectTransform>());
                SetSelectedOption(retryOption);
            });

            retryOption.OnOptionPressed.AddListener(() =>
            {
                Locator.Get <GameManager>().ResetGame();
            });

            mainMenuOption.OnOptionSelected.AddListener(() =>
            {
                MoveSelector(mainMenuOption.GetComponent <RectTransform>());
                SetSelectedOption(mainMenuOption);
            });

            mainMenuOption.OnOptionPressed.AddListener(() =>
            {
                Locator.Get <GameManager>().TidyGame();
                SceneManager.LoadScene(mainMenu);
            });
        }
示例#2
0
        private void SubscribeUIListeners()
        {
            continueOption.OnOptionSelected.AddListener(() =>
            {
                MoveSelector(continueOption.GetComponent <RectTransform>());
                SetSelectedOption(continueOption);
            });

            continueOption.OnOptionPressed.AddListener(() =>
            {
                gameManager.SetState(GameState.Running);
            });

            retryOption.OnOptionSelected.AddListener(() =>
            {
                MoveSelector(retryOption.GetComponent <RectTransform>());
                SetSelectedOption(retryOption);
            });

            retryOption.OnOptionPressed.AddListener(() =>
            {
                gameManager.ResetGame();
            });

            mainMenuOption.OnOptionSelected.AddListener(() =>
            {
                MoveSelector(mainMenuOption.GetComponent <RectTransform>());
                SetSelectedOption(mainMenuOption);
            });

            mainMenuOption.OnOptionPressed.AddListener(() =>
            {
                gameManager.TidyGame();
                SceneManager.LoadScene(mainMenu);
            });
        }