Ejemplo n.º 1
0
        // -------------------------------------------

        /*
         * PlayInVRPressed
         */
        private void PlayWithARCore()
        {
            SoundsController.Instance.PlaySingleSound(SoundsConfiguration.SOUND_SELECTION_FX);
            MultiplayerConfiguration.SaveGoogleARCore(MultiplayerConfiguration.GOOGLE_ARCORE_ENABLED);
            if (MenuScreenController.Instance.EnableAppOrganization)
            {
                UIEventController.Instance.DispatchUIEvent(EVENT_SCREENARCORE_ENABLED_ARCORE, true);
                GoBackPressed();
            }
            else
            {
                MenuScreenController.Instance.LoadGameScene(this);
            }
        }
        // -------------------------------------------

        /*
         * LoadGame
         */
        private void LoadGame(bool _setLevel)
        {
            if (MenuScreenController.Instance.EnableAppOrganization)
            {
                UIEventController.Instance.DispatchUIEvent(EVENT_SCREENCHARACTERSELECTION_SELECTED_CHARACTER, m_indexSelected);
                GoBackPressed();
            }
            else
            {
#if ENABLE_SELECT_LEVEL
                UIEventController.Instance.DispatchUIEvent(UIEventController.EVENT_SCREENMANAGER_OPEN_GENERIC_SCREEN, ScreenLevelSelectionView.SCREEN_NAME, UIScreenTypePreviousAction.DESTROY_ALL_SCREENS, false, null);
#elif ENABLE_GOOGLE_ARCORE
                UIEventController.Instance.DispatchUIEvent(UIEventController.EVENT_SCREENMANAGER_OPEN_GENERIC_SCREEN, ScreenEnableARCore.SCREEN_NAME, UIScreenTypePreviousAction.DESTROY_ALL_SCREENS, false, null);
#else
                MultiplayerConfiguration.SaveGoogleARCore(MultiplayerConfiguration.GOOGLE_ARCORE_DISABLED);
                MenuScreenController.Instance.LoadGameScene(this);
#endif
            }
        }
        // -------------------------------------------

        /*
         * PlayAsSpectator
         */
        private void PlayAsSpectator()
        {
            if (MenuScreenController.Instance.EnableAppOrganization)
            {
                UIEventController.Instance.DispatchUIEvent(EVENT_SCREENDIRECTORMODE_SELECTED_PROFILE, FunctionsScreenController.PROFILE_PLAYER.SPECTATOR);
                GoBackPressed();
            }
            else
            {
                if (NetworkEventController.Instance.MenuController_LoadNumberOfPlayers() == MultiplayerConfiguration.VALUE_FOR_JOINING)
                {
                    MultiplayerConfiguration.SaveDirectorMode(MultiplayerConfiguration.DIRECTOR_MODE_ENABLED);
                    MultiplayerConfiguration.SaveSpectatorMode(MultiplayerConfiguration.SPECTATOR_MODE_ENABLED);
                    CardboardLoaderVR.Instance.SaveEnableCardboard(false);
                    MultiplayerConfiguration.SaveGoogleARCore(MultiplayerConfiguration.GOOGLE_ARCORE_DISABLED);

                    MenuScreenController.Instance.LoadGameScene(this);
                }
            }
        }
        // -------------------------------------------

        /*
         * PlayAsDirector
         */
        private void PlayAsDirector()
        {
            SoundsController.Instance.PlaySingleSound(SoundsConfiguration.SOUND_SELECTION_FX);
            MultiplayerConfiguration.SaveDirectorMode(MultiplayerConfiguration.DIRECTOR_MODE_ENABLED);
            MultiplayerConfiguration.SaveGoogleARCore(MultiplayerConfiguration.GOOGLE_ARCORE_DISABLED);
            CardboardLoaderVR.Instance.SaveEnableCardboard(false);
            if (MenuScreenController.Instance.EnableAppOrganization)
            {
                UIEventController.Instance.DispatchUIEvent(EVENT_SCREENDIRECTORMODE_SELECTED_PROFILE, FunctionsScreenController.PROFILE_PLAYER.DIRECTOR);
                GoBackPressed();
            }
            else
            {
                if (NetworkEventController.Instance.MenuController_LoadNumberOfPlayers() != MultiplayerConfiguration.VALUE_FOR_JOINING)
                {
                    MultiplayerConfiguration.SaveCharacter6DOF(0);
                    MultiplayerConfiguration.SaveLevel6DOF(0);
                }

                MenuScreenController.Instance.LoadGameScene(this);
            }
        }
        // -------------------------------------------

        /*
         * OnLocalPartyGame
         */
        private void OnLocalPartyGame()
        {
            if (MenuScreenController.Instance.EnableAppOrganization)
            {
                UIEventController.Instance.DispatchUIEvent(EVENT_SCREENMAIN_LOCAL_OR_REMOTE_PARTY, true);
                GoBackPressed();
            }
            else
            {
                NetworkEventController.Instance.MenuController_SetLocalGame(true);
                SoundsController.Instance.PlaySingleSound(SoundsConfiguration.SOUND_SELECTION_FX);

#if UNITY_STANDALONE
                CardboardLoaderVR.Instance.SaveEnableCardboard(false);
                MultiplayerConfiguration.SaveDirectorMode(MultiplayerConfiguration.DIRECTOR_MODE_DISABLED);
                MultiplayerConfiguration.SaveGoogleARCore(MultiplayerConfiguration.GOOGLE_ARCORE_DISABLED);
                MenuScreenController.Instance.ScreenGameOptions = ScreenCharacterSelectionView.SCREEN_NAME;
                MenuScreenController.Instance.CreateRoomInServer(1, MultiplayerConfiguration.LoadExtraData());
#else
                UIEventController.Instance.DispatchUIEvent(UIEventController.EVENT_SCREENMANAGER_OPEN_GENERIC_SCREEN, ScreenMenuLocalGameView.SCREEN_NAME, UIScreenTypePreviousAction.DESTROY_ALL_SCREENS, false, null);
#endif
            }
        }