コード例 #1
0
    private IEnumerator NextScene()
    {
        yield return(new WaitForSeconds(60f));

        GameObject.Find("LevelLoader").GetComponent <Animator>().SetTrigger("End");
        fadeMusic.StartFadeOut(scroll.GetComponent <AudioSource>(), 5f);
        yield return(new WaitForSeconds(5f));

        SceneManager.LoadScene(1);
    }
コード例 #2
0
    public override IEnumerator WaitToDie(float time)
    {
        fadeMusic.StartFadeOut(fadeMusic.GetComponent <AudioSource>(), 3f);
        yield return(new WaitForSeconds(time / 2));

        float pauseEndTime = Time.realtimeSinceStartup + time / 2;

        while (Time.realtimeSinceStartup < pauseEndTime)
        {
            float a = spriteRenderer.color.a - Time.deltaTime;
            spriteRenderer.color = new Color(originalColor.r, originalColor.g, originalColor.b, a);
            yield return(0);
        }

        PlayerData data = SaveSystem.LoadPlayer();

        SaveSystem.SavePlayer(data.activePlayerIdData, data.currentSpawnPointIdData, data.healthData, data.maxHealthData, 0, data.obtainedPlayersNameData, data.doorsClosed);
        pm.GetComponent <PlayerManegerScript>().checkMana();
        levelLoader.GetComponent <SceneManeger>().ReloadScene();
    }
コード例 #3
0
 public void PlayButton()
 {
     fadeMusic.StartFadeOut(fadeMusic.GetComponent <AudioSource>(), 3f);
     StartCoroutine(PlayButtonCoroutine());
 }