private void CleanupScoreView() { if (scoreView_ != null) { ObjectPoolManager.Recycle(scoreView_); scoreView_ = null; } }
protected override void Activate() { timeSpentInArea_.Clear(); PlayerSpawner.SpawnAllPlayers(); List <GameModeIntroView.Icon> icons = new List <GameModeIntroView.Icon>(); foreach (Player player in RegisteredPlayers.AllPlayers) { icons.Add(GameModeIntroView.Icon.Player); icons.Add(GameModeIntroView.Icon.Swords); } icons.RemoveLast(); GameModeIntroView.Show(DisplayTitle, icons); MonoBehaviourWrapper.OnUpdate += HandleUpdate; PlayerSpawner.ShouldRespawn = true; CleanupScoreView(); scoreView_ = ObjectPoolManager.CreateView <KingOfTheHillScoreView>(GamePrefabs.Instance.KotHScoreViewPrefab); scoreView_.Init(this); }