private IEnumerator WaitUntilDestroyed() { while (!FinishedExplodeAnimation || !FinishedExplodeAudio) { yield return(null); } //Allow for specific behaviour first. enemyTypeBehaviour.ReactToExplode(); Destroy(gameObject); }
private IEnumerator WaitUntilDestroyed() { while (!FinishedExplodeAnimation || !FinishedExplodeAudio) { yield return(null); } //Allow for specific behaviour first. enemyTypeBehaviour.ReactToExplode(); Destroy(gameObject); }