using UnityEngine; using System.Collections; using System.Collections.Generic; using UnityEngine.UI; public class Spawn : MonoBehaviour { public Transform[] spawnLocations; public GameObject[] whatToSpawn; public GameObject[] whatToSpawnClone; public GameObject Player; private Chase zombie; void Start () { zombie.GetComponent().Player = player.transform; spawnZombie(); } void spawnZombie () { whatToSpawnClone[0] = Instantiate(whatToSpawn[0], spawnLocations[0].transform.position, Quaternion.Euler(0, 0, 0)) as GameObject; whatToSpawnClone[1] = Instantiate(whatToSpawn[1], spawnLocations[1].transform.position, Quaternion.Euler(0, 0, 0)) as GameObject; whatToSpawnClone[2] = Instantiate(whatToSpawn[2], spawnLocations[2].transform.position, Quaternion.Euler(0, 0, 0)) as GameObject; } }