Esempio n. 1
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        private IEnumerator LoadGame()
        {
            MenuMusicController.StopMusic();
            yield return(new WaitForSecondsRealtime(1.0f));

            GameplayStatics.TransitionToScene(_mapSettings.selectedMap.sceneName);
        }
Esempio n. 2
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. 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());
            }
        }
Esempio n. 4
0
        /// <summary>
        ///
        /// </summary>
        private void Start()
        {
            if (Debug.isDebugBuild && _gameModeSelectionPanel != null)
            {
                _gameModeSelectionPanel.SetActive(true);
            }

            if (showMaps)
            {
                _state = State.MapSelection;
                var position = transform.position;

                position.x         = ScreenWidth * -1.0f;
                transform.position = position;
            }

            SetCurrentStateActive(true);
            if (!MenuMusicController.isPlaying)
            {
                MenuMusicController.StartMusic();
            }
        }