GetSpawnPointsForTeam() public method

returns all spawn points that are for the given team number in the given game mode
public GetSpawnPointsForTeam ( int team, GameModes, gameMode ) : IEnumerable
team int
gameMode GameModes,
return IEnumerable
示例#1
0
    public void MovePlayerToSpawnPoint(IPlayer player)
    {
        SpawnPointManager mgr = SpawnPointManager.instance;

        if (mgr == null)
        {
            Debug.LogError("SpawnPointManager.instance was null!");
            return;
        }
        List <SpawnPoint> points = mgr.GetSpawnPointsForTeam(player.Team, this.Mode).ToList();
        int rand = Random.Range(0, points.Count);

        player.MoveTo(points[rand].transform);
    }