Beispiel #1
0
        protected override void OnStateEntered()
        {
            OnBattleStateEntered.Invoke();

            // cleanup in-case
            PlayerSpawner.CleanupAllPlayers();
            CleanupCurrentGameMode();

            InGameConstants.BattlePlayerPartsFade = false;
            reflectActionAccumulator_.BeginAccumulating();

            // TODO (darren): filtering based on options will be here
            if (QueuedGameMode != null)
            {
                currentGameMode_ = QueuedGameMode;
                QueuedGameMode   = null;
            }
            else
            {
                var unlockedModes = GameModesProgression.FilterByUnlocked(GameConstants.Instance.GameModes);
                currentGameMode_ = GameModesPlayedTracker.FilterByLeastPlayed(unlockedModes).ToArray().Random();
            }

            currentGameMode_.LoadArena(() => {
                currentGameMode_.ShowInstructionsIfNecessary(() => {
                    currentGameMode_.Activate(FinishBattle);

                    GameModeIntroView.OnIntroFinished += HandleIntroFinished;

                    InGamePlayerHUDEffect.CreateForAllPlayers();
                });
            });

            onSkipBattle_ = FinishBattle;
        }
Beispiel #2
0
 public void ActivateGameMode()
 {
     DestroyAllCars();
     gameMode.Activate();
 }