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;
    }
示例#2
0
    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);
    }
示例#3
0
    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;
    }