GetFFASpawnPoints() public method

returns all free-for-all spawn points for the given game mode
public GetFFASpawnPoints ( GameModes, gameMode ) : IEnumerable
gameMode GameModes,
return IEnumerable
Example #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.GetFFASpawnPoints(this.Mode).ToList();
        int rand = Random.Range(0, points.Count);

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