Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public IEnumerator Summon(int form,int max){ //Summon a formation from the formations array
- while (keepSummoning) {
- if (Enemy.enemiesAlive < max) {
- setFormLength (form);
- for (int i = 0; i < currentform.Length; i++) {
- GameObject newenemy = Instantiate (currentform [i]); //Instantiate one enemy from a child of the formation picked
- yield return new WaitForSeconds (.1f);
- }
- }
- yield return new WaitForSeconds (spawnrate);
- }
- }
- public void setFormLength(int form){
- currentform = new GameObject[formations [form].transform.childCount]; //setting length of currentform
- for (int i = 0; i < currentform.Length; i++){
- currentform [i] = formations [form].transform.GetChild(i).gameObject; //set each currentform value to be the next prefab child
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement