コード例 #1
0
 public static void Play <T>(T obj)
 {
     if (typeof(T) == typeof(Song))
     {
         Song song = obj as Song;
         if (currentSong == song)
         {
             if (!isPlaying)
             {
                 song.Resume();
             }
         }
         else
         {
             song.SetLoop(IsRepeating);
             currentSong = song;
             if (song.Loaded)
             {
                 song.Play();
                 isPlaying = true;
             }
             else
             {
                 contentManager.OnAllResourceLoaded = () =>
                 {
                     song.Play();
                     isPlaying = true;
                 };
             }
         }
     }
 }