GetStartPointsForTeam() public method

returns all start points that are for the given team number in the given game mode
public GetStartPointsForTeam ( int team, GameModes, gameMode ) : IEnumerable
team int
gameMode GameModes,
return IEnumerable
Example #1
0
    private void MoveTeamToStartPoints(int team, IEnumerable <IPlayer> players)
    {
        SpawnPointManager mgr = SpawnPointManager.instance;

        if (mgr == null)
        {
            Debug.LogError("SpawnPointManager.instance was null!");
            return;
        }
        var p      = players.GetEnumerator();
        var points = mgr.GetStartPointsForTeam(team, this.Mode).GetEnumerator();

        while (p.MoveNext())
        {
            points.MoveNext();
            if (points.Current == null)
            {
                Debug.LogError("Error; not enough start points for team " + team);
                points.Reset();
            }
            p.Current.MoveTo(points.Current.transform);
        }
        p.Dispose();
        points.Dispose();
    }