本文整理匯總了C#中Microsoft.Xna.Framework.Audio.Cue.Dispose方法的典型用法代碼示例。如果您正苦於以下問題:C# Cue.Dispose方法的具體用法?C# Cue.Dispose怎麽用?C# Cue.Dispose使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Microsoft.Xna.Framework.Audio.Cue
的用法示例。
在下文中一共展示了Cue.Dispose方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: PlayCue
void PlayCue(ref Cue cue)
{
if (cue.IsStopped || cue.IsStopping)
{
string name = cue.Name;
cue.Dispose();
cue = _soundBank.GetCue(name);
}
if (!cue.IsPlaying)
cue.Play();
}
示例2: PlaySoundMainSE
private void PlaySoundMainSE(string se)
{
engineSound2 = soundBank2.GetCue(se);
SetVolumeMainSE();
audioEngine.Update();
engineSound2.Play();
if (engineSound2.IsStopped == true)
{ engineSound2.Dispose(); }
else if (engineSound2.IsStopping == true)
{ engineSound2.Dispose(); }
}
示例3: StopSoundMainSE
private void StopSoundMainSE(string se)
{
if (engineSound2 != null)
{
engineSound2 = soundBank2.GetCue(se);
engineSound2.Stop(AudioStopOptions.AsAuthored);
waveBank2.Dispose();
soundBank2.Dispose();
engineSound2.Dispose();
audioEngine.Update();
engineSound2 = null;
}
}
示例4: CloseSoundMain
private void CloseSoundMain()
{
if (engineSound != null)
{
engineSound = soundBank.GetCue(bgmname);
engineSound.Stop(AudioStopOptions.AsAuthored);
waveBank.Dispose();
soundBank.Dispose();
engineSound.Dispose();
audioEngine.Update();
}
}