protected void SpawnZombie() { GameObject zombieToSpawn = Spawner.ZombiePrefabs[Random.Range(0, Spawner.ZombiePrefabs.Length)]; SpawnerVolumes spawnerVolumes = Spawner.SpawnerVolumes[Random.Range(0, Spawner.SpawnerVolumes.Length)]; GameObject zombie = Object.Instantiate(zombieToSpawn, spawnerVolumes.GetPositionInBounds(), spawnerVolumes.transform.rotation); zombie.GetComponent <ZombieComponment>().FollowTarget = Spawner.TargetObject; }
private void SpawnZombie() { GameObject zombieToSpawn = ZombiePrefabs[Random.Range(0, ZombiePrefabs.Length)]; SpawnerVolumes spawnVolume = SpawnVolumes[Random.Range(0, SpawnVolumes.Length)]; GameObject zombie = Instantiate(zombieToSpawn, spawnVolume.GetPositionInBounds(), spawnVolume.transform.rotation); zombie.GetComponent <ZombieComponent>().Initialize(FollowGameObject); }
private void SpawnZombie() { GameObject zombieToSpawn = ZombiePrefabs[UnityEngine.Random.Range(0, ZombiePrefabs.Length)]; SpawnerVolumes spawnerVolumes = SpawnerVolumes[UnityEngine.Random.Range(0, SpawnerVolumes.Length)]; GameObject zombie = Instantiate(zombieToSpawn, spawnerVolumes.GetPositionInBounds(), spawnerVolumes.transform.rotation); zombie.GetComponent <ZombieComponment>().FollowTarget = FollowGameObject; }