Advertisement
RealiteeeyyyyTV

Untitled

Jan 13th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine.UI;
  5.  
  6. public class Spawn : MonoBehaviour {
  7.  
  8. public Transform[] spawnLocations;
  9. public GameObject[] whatToSpawn;
  10. public GameObject[] whatToSpawnClone;
  11. public GameObject Player;
  12. private Chase zombie;
  13.  
  14. void Start ()
  15. {
  16. zombie.GetComponent<Chase>().Player = player.transform;
  17. spawnZombie();
  18. }
  19.  
  20. void spawnZombie ()
  21. {
  22. whatToSpawnClone[0] = Instantiate(whatToSpawn[0], spawnLocations[0].transform.position, Quaternion.Euler(0, 0, 0)) as GameObject;
  23. whatToSpawnClone[1] = Instantiate(whatToSpawn[1], spawnLocations[1].transform.position, Quaternion.Euler(0, 0, 0)) as GameObject;
  24. whatToSpawnClone[2] = Instantiate(whatToSpawn[2], spawnLocations[2].transform.position, Quaternion.Euler(0, 0, 0)) as GameObject;
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement