IEnumerator BattleEnd() { boss.GetComponent <BossController>().SetDeathState(); //disable components yield return(new WaitForSeconds(.1f)); Time.timeScale = 0; Camera.main.backgroundColor = Color.white; BGMPlayer.Stop(); yield return(new WaitForSecondsRealtime(1f)); PlayerMovement playerMovement = player.GetComponent <PlayerMovement>(); playerMovement.StartCoroutine(playerMovement.GoToThePositonAndLookCenter(8)); Time.timeScale = 1; screenShaker.Call(10, 5); yield return(new WaitForSeconds(3)); yield return(FadeToWhite()); yield return(new WaitForSeconds(1)); resultScreen.gameObject.SetActive(true); TimeSpan battleTime; string clearTime; if (battleStart != null) { battleTime = (DateTime.Now - battleStart); clearTime = battleTime.Minutes.ToString("00") + ":" + battleTime.Seconds.ToString("00") + ":" + battleTime.Milliseconds.ToString("000"); } else { clearTime = "X:XX:XXX"; } resultScreen.SetValues(clearTime, PlayerHealth.deathCount, player.GetComponent <PlayerHealth>().value); yield return(new WaitUntil(() => resultScreen.allowRestart)); yield return(new WaitUntil(() => Input.GetButtonDown("Jump"))); CallScene(0); }
public void GameOver() { resultsScreen.SetValues(totalNotes, perfectHits, normalHits, missedNotes, longestStreak, longestPrefectStreak); resultsScreen.EnableScreen(true); }