IEnumerator GoEndScene() { yield return(new WaitForSeconds(2.0f)); var overlay = Instantiate(Resources.Load("Prefab/FadeOut") as GameObject); yield return(new WaitForSeconds(2.0f)); overlay.SetActive(false); _pauseButton.Close(); var ui = UIManager.OpenUI <EndStageUI>(Resources.Load("Prefab/EndStageUI") as GameObject); _stage.OnEnd(ui); _hitNote = _stageNostes.Count((x) => x._type == NoteType.Touch && x._isSucceed); _totalNote = _stageNostes.Count((x) => x._type == NoteType.Touch); ui.SetScore(_hitNote, _totalNote); _stageObject.SetActive(false); }