/// <summary> /// Registers the other players in the scene. /// </summary> public void FindOtherPlayers() { MinionTuneSpawn minion = GetComponent <MinionTuneSpawn>(); PlayerID selfID; if (minion != null) { selfID = minion.owner; isMinion = true; } else { selfID = control.player; } otherPlayers = new List <BaseControl>(); BaseControl[] otherPlayersArray; if (Assets.Scripts.Data.RoundHandler.Instance != null) { otherPlayersArray = Assets.Scripts.Data.RoundHandler.Instance.Control(); } else { otherPlayersArray = FindObjectsOfType <BaseControl>(); } foreach (BaseControl otherPlayer in otherPlayersArray) { if (otherPlayer.player != selfID && otherPlayer.GetComponent <MinionTuneSpawn>() == null) { otherPlayers.Add(otherPlayer); } } hill = FindObjectOfType <KingofHill>(); }
/// <summary> Increments the death count for this round or sets the given player to respawn. </summary> /// <param name="id"> The player that died. </param> public void AddDeath(PlayerID id) { if (id != PlayerID.None) { if (Data.Instance.IsElimination) { deathCount++; isDead[((int)id) - 1] = true; } else { KingofHill k = bards[(((int)id) - 1)].gameObject.GetComponentInChildren <KingofHill>(); if (k != null) { k.ResetRound(); hill.transform.parent = null; hill.transform.position = spawnPoints[4].transform.position; } StartCoroutine(Respawn(((int)id) - 1)); } } }