// ------------------------------------------- /* * ConfirmNumberPlayers */ private void ConfirmNumberPlayers() { bool loadNextScreen = true; if (loadNextScreen) { SoundsController.Instance.PlaySingleSound(SoundsConfiguration.SOUND_SELECTION_FX); if (MenuScreenController.Instance.EnableAppOrganization) { UIEventController.Instance.DispatchUIEvent(EVENT_SCREENNUMBERPLAYERS_SET_NUMBER_PLAYERS, FinalNumberOfPlayers); GoBackPressed(); } else { UIEventController.Instance.DispatchUIEvent(MenuScreenController.EVENT_MENUEVENTCONTROLLER_CREATED_NEW_GAME, FinalNumberOfPlayers); if (FinalNumberOfPlayers == 1) { MultiplayerConfiguration.SaveDirectorMode(MultiplayerConfiguration.DIRECTOR_MODE_DISABLED); MenuScreenController.Instance.ScreenGameOptions = ScreenCharacterSelectionView.SCREEN_NAME; } else { MenuScreenController.Instance.ScreenGameOptions = ScreenDirectorModeView.SCREEN_NAME; } MenuScreenController.Instance.LoadCustomGameScreenOrCreateGame(false, FinalNumberOfPlayers, "", null); } } }
// ------------------------------------------- /* * PlayLocalGame */ private void PlayLocalGame() { #if ENABLE_PHOTON if (GameObject.FindObjectOfType <PhotonController>() != null) { PhotonController.Instance.Destroy(); } #elif ENABLE_NAKAMA if (GameObject.FindObjectOfType <NakamaController>() != null) { NakamaController.Instance.Destroy(); } #endif NetworkEventController.Instance.MenuController_SetLocalGame(true); NetworkEventController.Instance.MenuController_SetLobbyMode(false); SoundsController.Instance.PlaySingleSound(SoundsConfiguration.SOUND_SELECTION_FX); #if UNITY_WEBGL MultiplayerConfiguration.SaveDirectorMode(MultiplayerConfiguration.DIRECTOR_MODE_DISABLED); UIEventController.Instance.DispatchUIEvent(MenuScreenController.EVENT_MENUEVENTCONTROLLER_CREATED_NEW_GAME, 1); CardboardLoaderVR.Instance.SaveEnableCardboard(false); MenuScreenController.Instance.LoadCustomGameScreenOrCreateGame(false, 1, "", null); #else if (MenuScreenController.Instance.AlphaAnimationNameStack != -1) { UIEventController.Instance.DispatchUIEvent(UIEventController.EVENT_SCREENMANAGER_OPEN_LAYER_GENERIC_SCREEN, -1, new List <object> { ScreenController.ANIMATION_ALPHA, 0f, 1f, MenuScreenController.Instance.AlphaAnimationNameStack }, ScreenMenuLocalGameView.SCREEN_NAME, UIScreenTypePreviousAction.DESTROY_ALL_SCREENS, false, null); } else { UIEventController.Instance.DispatchUIEvent(UIEventController.EVENT_SCREENMANAGER_OPEN_GENERIC_SCREEN, ScreenMenuLocalGameView.SCREEN_NAME, UIScreenTypePreviousAction.DESTROY_ALL_SCREENS, false, m_nameOfScreen); } #endif }
// ------------------------------------------- /* * Will load the game scene after 1 second delay */ public void MenuController_LoadGameScene(string _targetScene) { if (m_targetScene.Length == 0) { m_targetScene = _targetScene; #if ENABLE_OCULUS || ENABLE_WORLDSENSE || ENABLE_HTCVIVE || ENABLE_PICONEO MultiplayerConfiguration.SaveDirectorMode(MultiplayerConfiguration.DIRECTOR_MODE_DISABLED); #endif StartCoroutine(LoadScene()); } }
// ------------------------------------------- /* * PlayAsCustomer */ private void PlayAsCustomer() { SoundsController.Instance.PlaySingleSound(SoundsConfiguration.SOUND_SELECTION_FX); MultiplayerConfiguration.SaveDirectorMode(MultiplayerConfiguration.DIRECTOR_MODE_DISABLED); if (MenuScreenController.Instance.EnableAppOrganization) { UIEventController.Instance.DispatchUIEvent(EVENT_SCREENDIRECTORMODE_SELECTED_PROFILE, FunctionsScreenController.PROFILE_PLAYER.PLAYER); GoBackPressed(); } else { NextscreenForPlayAsCustomer(); } }
// ------------------------------------------- /* * 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 } }