Example #1
0
        protected override void OnStateEntered()
        {
            if (!PlayerScores.HasPendingScores)
            {
                HandleScoringFinished();
                return;
            }

            InGameConstants.AllowChargingLasers = false;
            InGameConstants.EnableQuacking      = true;

            GameModesProgressionNextUnlockView.ShowIfPossible();
            ActionHintTrackerUtil.ShowIfNecessary(HintKey.CelebrateAction, HintKey.ReflectAction);
            celebrateActionAccumulator_.BeginAccumulating();

            if (InGameConstants.ZoomInOnSurvivors)
            {
                BattleCamera.Instance.SetSurvivingPlayersAsTransformsOfInterest();
            }

            if (InGameConstants.ShowScoringView)
            {
                CoroutineWrapper.DoAfterDelay(kShowDelay, () => {
                    InGamePlayerScoringView.Show(HandleScoringFinished);
                });
            }
            else
            {
                CoroutineWrapper.DoAfterDelay(kShowDelay + 2.0f, () => {
                    HandleScoringFinished();
                });
            }
        }
Example #2
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;
        }