Exemple #1
0
        public override void Initialize(MenuManager menuManager)
        {
            base.Initialize(menuManager);

            _elements.BackButton.onClick.AddListener(OnClickBack);
            _elements.RestartButton.onClick.AddListener(OnClickRestart);
            MiniBus.SubscribeToEvent(GameEvent.Score, OnUpdateScore);
        }
Exemple #2
0
        public override void Initialize(MenuManager menuManager)
        {
            base.Initialize(menuManager);

            MiniBus.SubscribeToEvent(GameEvent.Score, OnUpdateScore);
            MiniBus.SubscribeToEvent(GameEvent.HighScore, OnUpdateHighScore);
            MiniBus.SubscribeToEvent(GameEvent.GemCount, OnUpdateGemCount);
            _elements.HighScoreText.text = Services.GetScoreService().GetHighScore().ToString();
        }
Exemple #3
0
        public override void Initialize(MenuManager menuManager)
        {
            base.Initialize(menuManager);

            _elements.PlayButton.onClick.AddListener(OnClickPlay);
            _elements.ToggleSoundButton.onClick.AddListener(OnClickToggleSound);
            _elements.SoundImages[0].SetActive(Services.GetAudioService().IsMuted);
            _elements.SoundImages[1].SetActive(!Services.GetAudioService().IsMuted);
            _elements.HighScoreText.text = Services.GetScoreService().GetHighScore().ToString();
            _elements.GemCountText.text  = Services.GetScoreService().GetGemCount().ToString();

            MiniBus.SubscribeToEvent(GameEvent.HighScore, OnUpdateHighScore);
            MiniBus.SubscribeToEvent(GameEvent.GemCount, OnUpdateGemCount);
        }