Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. public class Spawner : MonoBehaviour
  2. {
  3.  
  4. public GameObject EnemyPrefab;
  5. public float respawnTime = 260;
  6.  
  7.  
  8. void Start()
  9. {
  10.  
  11. }
  12.  
  13. void Update()
  14. {
  15. if (respawnTime <= 0)
  16. {
  17.  
  18. Instantiate(EnemyPrefab);
  19.  
  20. respawnTime = 260;
  21. }
  22. else
  23. {
  24. respawnTime = respawnTime - 1;
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement