コード例 #1
0
        BackgroundMusic ChooseTheme()
        {
            List <BackgroundMusic> soundList = GetAllThemesFor(SceneManager.GetActiveScene().name);
            BackgroundMusic        theme     = soundList[UnityEngine.Random.Range(0, soundList.Count)];

            return(theme);
        }
コード例 #2
0
 void PlayTheme(BackgroundMusic theme)
 {
     if (isAudioMute)
     {
         return;
     }
     if (currentlyPlayedTheme != null)
     {
         StartCoroutine(currentlyPlayedTheme.SwellDown());
     }
     Play(this.gameObject, theme, true);
     theme.myRoutine      = StartCoroutine(theme.SwellUp());
     currentlyPlayedTheme = theme;
 }