// PRAGMA MARK - Public Interface public void Init(Action playAgainCallback, Action goToMainMenuCallback) { playAgainCallback_ = playAgainCallback; goToMainMenuCallback_ = goToMainMenuCallback; playAgainView_ = CornerDelayedActionView.Show("PLAY ANOTHER ROUND", CornerPoint.BottomRight, ActionType.Positive, () => { if (playAgainCallback_ != null) { playAgainCallback_.Invoke(); playAgainCallback_ = null; } }); backToMainMenuView_ = CornerDelayedActionView.Show("BACK TO MAIN MENU", CornerPoint.BottomLeft, ActionType.Negative, () => { if (goToMainMenuCallback_ != null) { goToMainMenuCallback_.Invoke(); goToMainMenuCallback_ = null; } }); unlockedGameModesText_.SetActive(false); if (GameModesProgression.HasLockedGameModes()) { unlockedGameModesText_.Text = string.Format("<size=33><b>{0}/{1}</b></size> GAME MODES UNLOCKED!", GameModesProgression.FilterByUnlocked(GameConstants.Instance.GameModes).Count(), GameConstants.Instance.GameModes.Length); unlockedGameModesText_.SetActive(true); } }
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; }
// PRAGMA MARK - Internal public static void ResetAllThings() { GameModeShowedInstructionsCache.ResetShowedInstructionsCache(); GameModesPlayedTracker.Reset(); GameModesProgression.Reset(); foreach (var tracker in ActionHintTrackerRegistry.AllTrackers) { tracker.ResetTracking(); } }