Esempio n. 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="data"></param>
        private IEnumerator OnSubmit(UINavigationData data)
        {
            var shakeTime     = 0.5f;
            var shakeStrenght = 5f;
            var shakeVibrato  = 50;

            switch (data.actionName)
            {
            case "Start":
                data.navigationHandler.Unfocus();
                ShakeAllControllers();
                MatchSettingsManager.showMaps = false;
                yield return(UITitleScreenPanel.titleScreenPanelInstance.playButton.transform.DOShakePosition(shakeTime, shakeStrenght, shakeVibrato).WaitForCompletion());

                UITitleScreenPanel.CloseTitleScreenPanel();
                break;

            case "Settings":
                data.navigationHandler.Unfocus();
                ShakeAllControllers();
                yield return(UITitleScreenPanel.titleScreenPanelInstance.settingsButton.transform.DOShakePosition(shakeTime, shakeStrenght, shakeVibrato).WaitForCompletion());

                UITitleScreenPanel.titleScreenPanelInstance.gameObject.SetActive(false);

                SettingsPanelNavigationHandler.OpenSettingsPanel(() =>
                {
                    data.navigationHandler.Focus();
                    UITitleScreenPanel.titleScreenPanelInstance.gameObject.SetActive(true);
                });
                break;

            case "Credits":
                data.navigationHandler.Unfocus();
                ShakeAllControllers();
                yield return(UITitleScreenPanel.titleScreenPanelInstance.creditsButton.transform.DOShakePosition(shakeTime, shakeStrenght, shakeVibrato).WaitForCompletion());

                UITitleScreenPanel.titleScreenPanelInstance.gameObject.SetActive(false);
                var credits = FindObjectOfType <Credits>();
                credits?.StartCredits(() =>
                {
                    data.navigationHandler.Focus();
                    UITitleScreenPanel.titleScreenPanelInstance.gameObject.SetActive(true);
                });
                UITitleScreenPanel.titleScreenPanelInstance.gameObject.SetActive(false);
                break;

            case "QuitGame":
                data.navigationHandler.Unfocus();
                ShakeAllControllers();
                MenuMusicController.StopMusic();
                yield return(UITitleScreenPanel.titleScreenPanelInstance.quitButton.transform.DOShakePosition(shakeTime, shakeStrenght, shakeVibrato).WaitForCompletion());

                GameplayStatics.TransitionToScene(GameConstants.SupportScene);
                break;
            }
        }
Esempio n. 2
0
        /// <summary>
        ///
        /// </summary>
        private void StartTitleFlicker()
        {
            this.EmitSound(TitleScreenSoundKey);

            Sequence sequence = DOTween.Sequence();

            for (var i = 0; i < _flickerCount; i++)
            {
                sequence.Append(_titleImage.DOFade(0f, 0.08f));
                sequence.Append(_titleImage.DOFade(1f, 0.08f));
            }
            sequence.Append(_titleImage.DOFade(0f, 0.5f));
            sequence.AppendCallback(() => UITitleScreenPanel.OpenTitleScreenPanel());
            _anyButtonText.gameObject.SetActive(false);
            for (var i = 0; i < GameConstants.MaxPlayerCount; ++i)
            {
                this.StartVibrationCoroutine(i + 1, 0.7f, 0.7f, 0.3f);
            }
        }
Esempio n. 3
0
        /// <summary>
        ///
        /// </summary>
        private void Start()
        {
            if (!MenuMusicController.isPlaying)
            {
                MenuMusicController.StartMusic();
            }

            if (_titleScreenPanelOpened)
            {
                UITitleScreenPanel.OpenTitleScreenPanel();
                _titleImage.gameObject.SetActive(false);
                _anyButtonText.gameObject.SetActive(false);
            }
            else
            {
                _titleImage.DOFade(0f, 0.01f);
                _anyButtonText.gameObject.SetActive(false);
                StartCoroutine(StartAnimation());
            }
        }