Skip to content

Instantly share code, notes, and snippets.

@daniele-quero
Last active June 25, 2021 14:34
Show Gist options
  • Save daniele-quero/715fc0eca5c9a5b4a25cd8a04f4990a8 to your computer and use it in GitHub Desktop.
Save daniele-quero/715fc0eca5c9a5b4a25cd8a04f4990a8 to your computer and use it in GitHub Desktop.
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