Exemplo n.º 1
0
        /// <summary>
        /// Call this to show/hide the scene transitioner.
        /// </summary>
        /// <param name="_doShow">If TRUE animates the transition IN and stops when the screen is covered, otherwise animates OUT</param>
        /// <param name="_onComplete">Eventual callback to call when the transition IN/OUT completes</param>
        public static void Show(bool _doShow, Action _onComplete = null)
        {
            GlobalUI.Init();

            GlobalUI.SceneTransitioner.SetContent();
            GlobalUI.SceneTransitioner.DoShow(_doShow, _onComplete);
        }
Exemplo n.º 2
0
        public void Show(bool _doShow, bool _immediate = false)
        {
            GlobalUI.Init();

            IsShown = _doShow;
            if (_doShow)
            {
                clicked = false;
                if (_immediate)
                {
                    I.showTween.Complete();
                }
                else
                {
                    I.showTween.PlayForward();
                }
            }
            else
            {
                if (_immediate)
                {
                    I.showTween.Rewind();
                }
                else
                {
                    I.showTween.PlayBackwards();
                }
            }
        }
Exemplo n.º 3
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
                    if (AppManager.I.NavigationManager.NavData.CurrentScene == AppScene.MiniGame)
                    {
                        // Prompt
                        GlobalUI.ShowPrompt(Database.LocalizationDataId.UI_AreYouSure, () => {
                            OpenMenu(false);
                            AppManager.I.NavigationManager.ExitToMainMenu();
                        }, () => { }, keeperMode: KeeperMode.LearningNoSubtitles);
                    }
                    else
                    {
                        // No prompt
                        OpenMenu(false);
                        AppManager.I.NavigationManager.ExitToMainMenu();
                    }
                    break;

                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.SubtitlesToggle:
                    AppManager.I.AppSettingsManager.ToggleKeeperSubtitles();
                    BtSubtitles.Toggle(AppManager.I.AppSettings.KeeperSubtitlesEnabled);
                    break;

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

                case MenuButtonType.Continue:     // Resume
                    OpenMenu(false);
                    break;
                }
            }
        }
Exemplo n.º 4
0
 void OnComplete()
 {
     Time.timeScale = 1;
     GlobalUI.Clear(false);
     if (onCompleteCallback != null)
     {
         onCompleteCallback();
     }
 }
Exemplo n.º 5
0
 public void Close()
 {
     /*
      * if (moveTween != null && moveTween.IsPlaying()) moveTween.Kill();
      * moveTween = DOTween.Sequence().SetAutoKill(false)
      *  .Append(GetComponent<RectTransform>().DOAnchorPosY(-500, 0.2f))
      *  .OnComplete(() => gameObject.SetActive(false));
      */
     //moveTween.Play();
     GlobalUI.ShowPauseMenu(true);
     gameObject.SetActive(false);
 }
Exemplo n.º 6
0
        /// <summary>
        /// Activate view elements if SentenceId != "" and display sentence.
        /// </summary>
        public void DisplaySentence(Database.LocalizationData data, float _duration = 2, bool _isKeeper = false,
                                    System.Action _callback = null)
        {
            if (!AppManager.I.AppSettings.SubtitlesEnabled)
            {
                return;
            }

            GlobalUI.Init();
            this.StopAllCoroutines();
            currentCallback = _callback;
            showTween.PlayForward();
            if (_isKeeper)
            {
                bgColorTween.PlayBackwards();
            }
            else
            {
                bgColorTween.PlayForward();
            }
            WalkieTalkie.Show(_isKeeper);
            DisplayText(data, _duration);
        }
Exemplo n.º 7
0
        private void DisplayText(string learningText, string helpText, float fillPeriod = 2, bool _isKeeper = false,
                                 Action _callback = null)
        {
            if (!AppManager.I.AppSettings.KeeperSubtitlesEnabled)
            {
                return;
            }

            GlobalUI.Init();
            StopAllCoroutines();
            currentCallback = _callback;
            showTween.PlayForward();
            if (_isKeeper)
            {
                bgColorTween.PlayBackwards();
            }
            else
            {
                bgColorTween.PlayForward();
            }
            WalkieTalkie.Show(_isKeeper);

            Display(learningText, helpText, fillPeriod);
        }
Exemplo n.º 8
0
 public void Close()
 {
     GlobalUI.ShowPauseMenu(true);
     gameObject.SetActive(false);
 }
Exemplo n.º 9
0
 public void Open()
 {
     GlobalUI.ShowPauseMenu(false);
     gameObject.SetActive(true);
 }
Exemplo n.º 10
0
        // ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
        // ■■■ PUBLIC METHODS

        /// <summary>
        /// Call this to show/hide the continue screen.
        /// </summary>
        /// <param name="_onContinue">Eventual callback to call when the user clicks to continue</param>
        /// <param name="_mode">Mode</param>
        public static void Show(Action _onContinue, ContinueScreenMode _mode = ContinueScreenMode.ButtonWithBg, bool _pulseLoop = false)
        {
            GlobalUI.Init();
            GlobalUI.ContinueScreen.DoShow(_onContinue, _mode, _pulseLoop);
        }