// enemy 02 pattern // get call from Enemy_01_spawner void initiate_Event_C() { // path following enemy // this spawnEnemy will also call Enemy_5 formation follow the chain theEnemySpawner.spawnEnemy(); //theEventDelegate -= initiate_Event_C; }
IEnumerator Event_B() { float startTime = Time.time; // current time float duration = _event_B_duration; while (Time.time - startTime < duration) { yield return(new WaitForSeconds(Random.Range(max, min))); TopToDown(); } Debug.Log("event B done"); // start event C //EnemyEventManager.theEventDelegate (); MultipleEnemySpawner theEnemySpawner = GameObject.FindObjectOfType <MultipleEnemySpawner>(); if (theEnemySpawner != null) { print("initiate event C"); theEnemySpawner.spawnEnemy(); } }