private void Update() { if (!playerCharacter || playerCharacter.IsDead) { return; } if (currentRoutine == null) { currentRoutine = enemySpawnRoutines[Random.Range(0, enemySpawnRoutines.Length)]; currentRoutine.Start(); } else { currentRoutine.Update(); if (currentRoutine.IsComplete) { currentRoutine = null; } } }
public void Initialize(EnemySpawnRoutine routine) { parentRoutine = routine; }