예제 #1
0
        public static void EachFrame()
        {
            if (1 <= PlayInfos.Count)
            {
                PlayInfo info = PlayInfos.Dequeue();

                if (info != null)
                {
                    switch (info.Command)
                    {
                    case PlayInfo.Command_e.PLAY:
                        DDSoundUtils.Play(info.Music.Sound.GetHandle(0), info.Once, info.Resume);
                        break;

                    case PlayInfo.Command_e.VOLUME_RATE:
                        DDSoundUtils.SetVolume(info.Music.Sound.GetHandle(0), DDSoundUtils.MixVolume(DDGround.MusicVolume, info.Music.Volume) * info.VolumeRate);
                        break;

                    case PlayInfo.Command_e.STOP:
                        DDSoundUtils.Stop(info.Music.Sound.GetHandle(0));

#if true // 再生していたローカルBGMのみ解放する。
                        if (info.Music.Locally)
                        {
                            info.Music.Sound.Unload();
                        }
#else // 全てのローカルBGMを解放する。
                        DDMusicUtils.UnloadLocally();
#endif
                        break;

                    default:
                        throw new DDError();
                    }
                }
            }
        }
예제 #2
0
 private static void UnloadLocally()
 {
     DDPictureUtils.UnloadLocally();
     DDMusicUtils.UnloadLocally(music => !music.Sound.IsPlaying());
     DDSEUtils.UnloadLocally(se => !se.Sound.IsPlaying());
 }