示例#1
0
    /// <summary>
    /// This function respawn a single player after it died and waited
    /// for a certain amount of time.
    /// </summary>
    /// <param name="player">The player we have to respawn.</param>
    public void ReassingSinglePlayer(PlayerAI player)
    {
        PCBehavior spawnPC = PCManager.Instance.GetRandomPC(player.selfTeam);

        // if no other pc are available
        if (spawnPC == null)
        {
            return;
        }

        player.gameObject.SetActive(true);

        //player.SetNewPosition(PCManager.Instance.GetRandomPC(player.selfTeam).trans.position);
        player.DispatchPlayer(spawnPC);
        //tickets[(int)player.selfTeam] -= 1;
        Teams[(int)player.selfTeam].Add(player);
        DeadPlayers.Remove(DeadPlayers.Where(x => x.player == player).First());
        //TeamsDeads[(int)player.selfTeam].Remove(player);
    }