IEnumerator BackgroundUpdateRoutine() { while (true) { if (_count >= _endCount) { SpawnerEvent.Trigger(SpawnerState.Pasue); if (GameManager._totalEnemyCount == 0) { PasueGameEvent.Trigger(); BgmManager.Instance.Pause(); SpawnEvent.Trigger(Direction.Left, EnemyType.Boss); _endPoint.position = _nextGenPos + endPointOffset; _endPoint.gameObject.SetActive(true); yield break; } } BackgroundUpdate(); yield return(new WaitForFixedUpdate()); } }