public override void Initialize(MenuManager menuManager) { base.Initialize(menuManager); _elements.BackButton.onClick.AddListener(OnClickBack); _elements.RestartButton.onClick.AddListener(OnClickRestart); MiniBus.SubscribeToEvent(GameEvent.Score, OnUpdateScore); }
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(); }
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); }