void OnClick(MenuButton bt) { switch (bt.Type) { case MenuButtonType.MusicToggle: // Music on/off AudioManager.I.ToggleMusic(); BtMusic.Toggle(AudioManager.I.MusicEnabled); break; case MenuButtonType.FxToggle: // FX on/off AppManager.I.AppSettingsManager.ToggleQualitygfx(); BtFx.Toggle(AppManager.I.AppSettings.HighQualityGfx); break; case MenuButtonType.Continue: HomeMngr.Play(); break; case MenuButtonType.Credits: CreditsWindow.Open(); break; } }
void Start() { // By default, the letter shows a truly random letter LLInStage.Init(AppManager.I.Teacher.GetRandomTestLetterLL(useMaxJourneyData: true)); Setup(); btAddTween = BtAdd.transform.DORotate(new Vector3(0, 0, -45), 0.3f).SetAutoKill(false).Pause() .SetEase(Ease.OutBack) .OnRewind(() => { if (AppManager.I.PlayerProfileManager.GetPlayersIconData() == null || AppManager.I.PlayerProfileManager.GetPlayersIconData().Count == 0) { BtAdd.Pulse(); } }); btPlayTween = DOTween.Sequence().SetAutoKill(false).Pause() .Append(BtPlay.RectT.DOAnchorPosY(-210, 0.2f).From(true)) .OnPlay(() => BtPlay.gameObject.SetActive(true)) .OnRewind(() => BtPlay.gameObject.SetActive(false)) .OnComplete(() => BtPlay.Pulse()); BtPlay.gameObject.SetActive(false); // Listeners BtAdd.Bt.onClick.AddListener(() => OnClick(BtAdd)); BtPlay.Bt.onClick.AddListener(() => { AudioManager.I.PlaySound(Sfx.UIButtonClick); HomeScene.Play(); }); foreach (PlayerIcon pIcon in playerIcons) { PlayerIcon p = pIcon; p.UIButton.Bt.onClick.AddListener(() => OnSelectProfile(p)); } }