Exemplo n.º 1
0
    private IEnumerator GameOver()
    {
        // restore UI color
        materialController.RestoreTextsColor();
        uiController.ShowGameOver();

        // register Hi-Score to the store if it is new record
        var globalStore = GlobalStore.Instance;

        if (globalStore.ScoreStore.CurrentScore > globalStore.ScoreStore.HiScore)
        {
            globalStore.ScoreStore.UpdateHiScore();
        }

        // reset current stage info
        globalStore.StageStore.SetDefault();

        yield return(new WaitForSeconds(0.8f));

        // wait for key press
        while (true)
        {
            if (Input.anyKeyDown)
            {
                // TODO: go to ranking scene
                NextStateSet(GetComponent <TitleState>());
                yield break;
            }

            yield return(null);
        }
    }