Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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<Chase>().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;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement