public void End() { if (gameCamera) { gameCamera.DisableFocusCamera(); } if (AvailablePlayers.Count != 1) { Debug.Log("It ended in a draw! Reward them all!"); notifications.ShowDraw(); foreach (var player in JoinedPlayers) { player.Arena.OnWin(true); player.Arena.OnLeave(); } } else { // do something awesome for the winning player var winner = AvailablePlayers.First(); winner.Arena.OnWin(false); notifications.ShowWinner(winner); foreach (var player in JoinedPlayers) { player.Arena.OnLeave(); } } ResetState(); }
public void EndRaid(bool bossKilled, bool timeout) { gameManager.Music.PlayBackgroundMusic(); raidEndedTime = Time.time; camera.DisableFocusCamera(); ScheduleNextRaid(); notifications.HideRaidInfo(); lock (mutex) { var playersToLeave = raidingPlayers.ToList(); foreach (var player in playersToLeave) { Leave(player, bossKilled, timeout); } } if (!Boss.RaidBossControlsDestroy || timeout) { Destroy(Boss.gameObject); } gameManager.Events.End(this); }
public void EndRaid(bool bossKilled, bool timeout) { raidEndedTime = Time.time; camera.DisableFocusCamera(); nextRaidTimer = UnityEngine.Random.Range(minTimeBetweenRaids, maxTimeBetweenRaids); notifications.HideRaidInfo(); var playersToLeave = this.raidingPlayers.ToList(); foreach (var player in playersToLeave) { Leave(player, bossKilled, timeout); } Destroy(Boss.gameObject); }
public void EndRaid(bool bossKilled, bool timeout) { gameManager.Music.PlayBackgroundMusic(); raidEndedTime = Time.time; camera.DisableFocusCamera(); nextRaidTimer = UnityEngine.Random.Range(minTimeBetweenRaids, maxTimeBetweenRaids); notifications.HideRaidInfo(); lock (mutex) { var playersToLeave = raidingPlayers.ToList(); foreach (var player in playersToLeave) { Leave(player, bossKilled, timeout); } } Destroy(Boss.gameObject); }