Beispiel #1
0
 public void ToggleBGM(Text text)
 {
     if (this.bgm)
     {
         SoundModule.Instance.StopBGM();
         text.text = "bgm\nOff";
         module.Flush();
     }
     else
     {
         SoundModule.Instance.PlayBGM(0, () => {
             text.text = "bgm\nOff";
         });
         if (Song.currentSong == null)
         {
             module.Init(Song.LoadSong("freerider"));
         }
         else
         {
             module.Init(Song.currentSong);
         }
         text.text = "bgm\nOn";
     }
     this.bgm = !this.bgm;
 }