Advertisement
Guest User

Untitled

a guest
May 25th, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. using UnityEngine;
  2.  
  3. public class WaveSpawner : MonoBehaviour
  4. {
  5.  
  6. public Transform enemyPrefab;
  7.  
  8. public float timeBetweenWaves = 10f;
  9. private float countdown = 5f;
  10.  
  11. void Update ()
  12. {
  13. if (countdown <= 0f)
  14. {
  15. SpawnWave();
  16. countdown = timeBetweenWaves;
  17. }
  18.  
  19. countdown -= Time.deltaTime;
  20. }
  21.  
  22. void SpawnWave ()
  23. {
  24. Debug.Log("Wave Incoming!");
  25. }
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement