Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private bool canSpawn = true;
- void Update () {
- if(canSpawn)
- StartCoroutine(WaitTime());
- }
- IEnumerator WaitTime(float seconds)
- {
- SpawnEnemy();
- canSpawn = false;
- yield return new WaitForSeconds(seconds);
- canSpawn = true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement