// Called by game starter to start the match public void StartMatch(GameMode gameMode) { // sets the selected gamemode and starts the match switch (gameMode) { case GameMode.FreeForAll: selectedGamemode = freeForAllGamemode; break; case GameMode.Elimination: break; case GameMode.Extraction: selectedGamemode = extractionGamemode; break; case GameMode.Climb: break; default: break; } // Goes to a random level from the playlist of the selected gamemode levelSelector.GoToLevel(gameMode, selectedGamemode.StartMatch); }
public Gamemode(string id, string displayName, BaseGamemode baseGamemode = BaseGamemode.Infection) { this.ID = id; this.DisplayName = displayName; this.BaseGamemode = baseGamemode; GamemodeString = GamemodePrefix + ID + (BaseGamemode == BaseGamemode.None ? "" : BaseGamemode.ToString().ToUpper()); }
// Called when the match is over or the player leaves // Returns back to the main menu scene and respawns all the characters // sets time scale back to 1 incase the players left through pause menu public void EndMatch() { if (SceneManager.GetActiveScene().buildIndex == 0) { return; } OnEndMatchEnd(); selectedGamemode.Exit(); selectedGamemode = null; SceneManager.LoadScene(0); UnPause(); StartCoroutine("CoEndMatch"); }
public ModdedGamemodeAttribute(string id, string displayName, BaseGamemode baseGamemode = BaseGamemode.Infection) { gamemode = new Gamemode(id, displayName, baseGamemode); }