本文整理汇总了C#中Audio.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# Audio.Dispose方法的具体用法?C# Audio.Dispose怎么用?C# Audio.Dispose使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Audio
的用法示例。
在下文中一共展示了Audio.Dispose方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Check
public bool Check()
{
try
{
Audio a = new Audio(this.FileName);
a.Dispose();
return true;
}
catch (Exception)
{
return false;
}
}
示例2: Run
//.........这里部分代码省略.........
}
break;
case GAME_SCENE:
if (bgm != null && !bgm.Playing)
{
bgm.Play();
}
switch (game.Tick(input.GetCurrentGameInput()))
{
case GameScene.NONE:
if (timer.ShouldRender() && video.CheckDrawable())
{
video.Begin();
video.DrawGameScene(game);
video.DrawFps(timer.GetCurrentFps());
video.End();
video.Present();
}
sound.PlayGameSound(game);
break;
case GameScene.RESET_GAME:
sound.StopSounds();
game = stages[currentStageIndex].CreateGame();
break;
case GameScene.CLEAR_GAME:
sound.StopSounds();
currentStageIndex = (currentStageIndex + 1) % numStages;
game = stages[currentStageIndex].CreateGame();
break;
case GameScene.SELECT:
if (timer.ShouldRender() && video.CheckDrawable())
{
video.Begin();
video.DrawGameScene(game);
video.DrawFps(timer.GetCurrentFps());
video.End();
video.Present();
}
sound.PlayGameSound(game);
select.CurrentStage = currentStageIndex;
state = SELECT_SCENE_GAME;
break;
case GameScene.GOTO_TITLE:
sound.StopSounds();
state = TITLE_SCENE;
break;
}
break;
case SELECT_SCENE_GAME:
game.Tick(GameInput.Empty);
{
int result = select.Tick(input.GetCurrentSelectInput());
switch (result)
{
case SelectScene.NONE:
if (timer.ShouldRender() && video.CheckDrawable())
{
video.Begin();
video.DrawGameScene(game);
video.DrawSelectScene(select);
video.DrawFps(timer.GetCurrentFps());
video.End();
video.Present();
}
sound.PlayGameSound(game);
sound.PlaySelectSound(select);
break;
case SelectScene.GOTO_TITLE:
sound.StopSounds();
state = TITLE_SCENE;
break;
default:
sound.StopSounds();
game = stages[currentStageIndex = result].CreateGame();
state = GAME_SCENE;
break;
}
}
break;
}
Application.DoEvents();
timer.Wait();
}
if (bgm != null)
{
if (bgm.Playing)
{
bgm.Stop();
}
bgm.Dispose();
bgm = null;
}
video.Dispose();
video = null;
sound.Dispose();
sound = null;
input.Dispose();
input = null;
}