Last active
June 25, 2021 14:34
-
-
Save daniele-quero/715fc0eca5c9a5b4a25cd8a04f4990a8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IEnumerator SpawnEnemy(float rate) | |
{ | |
while (true) | |
{ | |
Instantiate(_enemyPrefab, _position, Quaternion.identity) | |
.transform.SetParent(_enemyContainer.transform); | |
yield return new WaitForSeconds(rate); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment