private void Awake() { /* A gamemode will be automatically set only if the minigame scene is launched through the game. * If it's not valid, we grab the preset debug gamemode*/ if (GameState.Instance.IsGameStateValid()) { CurrentGamemode = GameState.Instance.Gamemode; } else { CurrentGamemode = DEBUG_GamemodeToTest; } if (CurrentGamemode != MinigameGamemodeTypes.TWOPLAYERVS) { if (Score1Text) { Score1Text.enabled = false; } if (Score2Text) { Score2Text.enabled = false; } } Instantiate(Settings.StartGameTransition); }
public void StartGame(MinigameGamemodeTypes GameModeSelected) { // We launch the debug minigame only if we are in the editor to make sure the build never uses a debug minigame if (Application.isEditor && DEBUG_MinigamesToLaunch.Length > 0) { GameState.Instance.SetupNewMinigames(DEBUG_MinigamesToLaunch, GameModeSelected); SceneTransitionController.Instance.TransitionToScene(Settings.MinigameLauncherScene.ScenePath); } else { // Add in minigames from shuffled list until we have enough minigames to play through the whole game MinigameInfo[] MinigamesToPlay = new MinigameInfo[MinigamesPerGame]; MinigameInfo[] ShuffledMinigames = Settings.GetShuffledMinigames(); int MinigamesAdded = 0; for (int i = 0; MinigamesAdded < MinigamesPerGame; i = (i + 1) % ShuffledMinigames.Length) { if (ShuffledMinigames[i].SupportedGameModes.HasFlag(GameModeSelected)) { MinigamesToPlay[MinigamesAdded] = ShuffledMinigames[i]; MinigamesAdded++; } } GameState.Instance.SetupNewMinigames(MinigamesToPlay, GameModeSelected); SceneTransitionController.Instance.TransitionToScene(Settings.MinigameLauncherScene.ScenePath); } }
public void SetupNewMinigames(MinigameInfo[] NewSelectedMinigames, MinigameGamemodeTypes NewGamemode) { MinigamesWon = 0; MinigamesPlayed = 0; MinigamesWonByP1 = 0; MinigamesWonByP2 = 0; LastMinigameFinishState = LastMinigameFinish.NONE; SelectedMinigames = NewSelectedMinigames; Gamemode = NewGamemode; }
private void Awake() { /* A gamemode will be automatically set only if the minigame scene is launched through the game. * If it's not valid, we grab the preset debug gamemode*/ if (GameState.Instance.IsGameStateValid()) { CurrentGamemode = GameState.Instance.Gamemode; } else { CurrentGamemode = DEBUG_GamemodeToTest; } Instantiate(Settings.StartGameTransition); }