Ejemplo n.º 1
0
        /// <summary>
        /// Callback for button clicks
        /// </summary>
        void OnClick(MenuButton _bt)
        {
            if (SceneTransitioner.IsPlaying)
            {
                return;
            }

            if (_bt == BtPause)
            {
                OpenMenu(!IsMenuOpen);
            }
            else if (!openMenuTween.IsPlaying())     // Ignores pause menu clicks when opening/closing menu
            {
                switch (_bt.Type)
                {
                case MenuButtonType.Back:     // Exit
                    OpenMenu(false);
                    NavigationManager.I.ExitAndGoHome();
                    break;

                case MenuButtonType.MusicToggle:     // Music on/off
                    AudioManager.I.ToggleMusic();
                    BtMusic.Toggle(AudioManager.I.MusicEnabled);
                    break;

                case MenuButtonType.FxToggle:     // FX on/off
                    AppManager.I.ToggleQualitygfx();
                    BtFx.Toggle(AppManager.I.GameSettings.HighQualityGfx);
                    break;

                case MenuButtonType.Credits:
                    Credits.Show(true);
                    break;

                case MenuButtonType.Continue:     // Resume
                    OpenMenu(false);
                    break;
                }
            }
        }
Ejemplo n.º 2
0
        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.ToggleQualitygfx();
                BtFx.Toggle(AppManager.I.GameSettings.HighQualityGfx);
                break;

            case MenuButtonType.Continue:
                HomeMngr.Play();
                break;

            case MenuButtonType.Credits:
                CreditsWindow.Open();
                break;
            }
        }