Exemplo n.º 1
0
    // Update is called once per frame

    public void SpawnPlayers()
    {
        Debug.Log("letsAGO");
        EventDriver eventDrivers = GameObject.FindObjectOfType <EventDriver>();

        locations = new List <GridTiles>();
        locations.AddRange(eventDrivers.FindPlayerSpawns());
        string tileId = "";

        spawnPoints = new List <NewSpawnPoint>();
        foreach (Unit play in CurrentGame.game.memoryGeneral.unitsInParty)
        {
            do
            {
                int num = Random.Range(0, locations.Count);
                if (!locations[num].taken)
                {
                    locations[num].taken = true;
                    tileId = locations[num].name;
                }
            } while (tileId == "");

            spawnPoints.Add(new NewSpawnPoint(play, tileId));
            tileId = "";
        }
        mapPlacer();
    }