void PlaceUnitsOnSpawnPoints(List <GameObject> units, ArenaBlock arenaBlock) { for (int i = 0; i < units.Count; i++) { Vector3 p = arenaBlock.spawnPoints[i].transform.position; //The following includes a hack. I'm not ACTUALLY working out where to place them on the Y, I'm just putting in a value that works for basic units as is. Will need remidying. units[i].transform.position = new Vector3(p.x, p.y + 0.05f, p.z); } }
void SetPositions() { for (int count = 0; count < ArenaBuilder.size; count++) { ArenaBlock arenaBlockScript = ArenaBuilder.arenaBlockList[count].GetComponent <ArenaBlock>(); arenaBlockScript.spawnPoints = ShuffleArray(arenaBlockScript.spawnPoints); } PlaceUnitsOnSpawnPoints(playerSquad, ArenaBuilder.encounterArenaBlockList[0].GetComponent <ArenaBlock>()); int blockToPlaceOn = 1; foreach (List <GameObject> cell in enemyCells) { PlaceUnitsOnSpawnPoints(cell, ArenaBuilder.encounterArenaBlockList[blockToPlaceOn].GetComponent <ArenaBlock>()); blockToPlaceOn++; } }