private void ChangeGameModeState(TGameMode l_newGameMode) { // Desactivate any gameObject that still active switch (m_CurrentGameMode) { case TGameMode.Protect: // Desactive HUD bar HUDController.Instance.SetActiveAllObjectiveBar(false, m_ProtectableObjectsPerRound); ActiveAllInteractableGameObjects(false); break; case TGameMode.Destroy: HUDController.Instance.SetActiveAllObjectiveBar(false, m_DestroyableObjectsPerRound); ActiveAllInteractableGameObjects(false); break; case TGameMode.Capture: HUDController.Instance.SetActiveObjectiveText(false); HUDController.Instance.DesactiveCollectGoals(); ActiveAllInteractableGameObjects(false); break; default: // Desactive all interactable objects ActiveAllInteractableGameObjects(false); break; } // End switch // Activate corresponding gameObjects switch (l_newGameMode) { case TGameMode.Protect: HUDController.Instance.SetActiveAllObjectiveBar(true, m_ProtectableObjectsPerRound); SetProtectableGameObjects(); break; case TGameMode.Destroy: HUDController.Instance.SetActiveAllObjectiveBar(true, m_DestroyableObjectsPerRound); SetDestroyableGameObjects(); break; case TGameMode.Capture: SetCapturableGameObjects(); break; } //Update HUD HUDController.Instance.UpdateGameModeObjective(l_newGameMode); HUDController.Instance.PlayAnimationGoal(l_newGameMode); // Update current state m_CurrentGameMode = l_newGameMode; //Set elapsed time m_ElapsedTime = 0; }