void Start() { // Getting the reference for the zombie pool Zpool = ResourcePooler.instance; // Starting the spawn z coroutine StartCoroutine(SpawnZ(Random.Range(0f, 4f))); }
// Use this for initialization void Start() { instance = this; objPool = new Queue <GameObject>(); foreach (Pool pool in pools) { // Instantiate all the game objects and store them in the queue GameObject obj = Instantiate(pool.prefab); obj.SetActive(false); objPool.Enqueue(obj); } }