private void SpawnZombie(Zombie myZombie) { int count = controller.GetCount(); if (count >= maxZombies) { return; } spawnedUnit = Instantiate(myZombie, transform.position, Quaternion.identity) as Zombie; controller.AddZombie(); spawn = false; }