Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- public class WaveSpawner : MonoBehaviour
- {
- public Transform enemyPrefab;
- public float timeBetweenWaves = 10f;
- private float countdown = 5f;
- void Update ()
- {
- if (countdown <= 0f)
- {
- SpawnWave();
- countdown = timeBetweenWaves;
- }
- countdown -= Time.deltaTime;
- }
- void SpawnWave ()
- {
- Debug.Log("Wave Incoming!");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement