コード例 #1
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        StartCoroutine(bruh());
        IEnumerator bruh()
        {
            if (off == false)
            {
                player.PauseGame();
                GlobalManager.instance.GetComponent <AudioSource>().Stop();
                GlobalManager.instance.GetComponent <AudioSource>().PlayOneShot(roar);

                yield return(new WaitForSecondsRealtime(clipTime));

                GlobalManager.instance.GetComponent <AudioSource>().clip = GlobalManager.instance.overworldMusic;
                GlobalManager.instance.GetComponent <AudioSource>().Play();
                Time.timeScale      = 1;
                player.isGamePaused = false;
                off = true;
            }
        }
    }