-
-
Save kihira/368008c6920f11c7309e to your computer and use it in GitHub Desktop.
This file contains 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
public List<GameObject> enemyFormations = new List<GameObject>(0); | |
void Update () | |
{ | |
// If we have no enemies on the screen, get a random prefab from our list and spawn it then ensure it is active | |
if (GameObject.FindGameObjectsWithTag("Enemy").Length <= 0) | |
{ | |
GameObject prefab = enemyFormations[Random.Range(0, enemyFormations.Count)]; | |
GameObject formation = Instantiate(prefab); | |
formation.SetActive(true); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment