SoundInstance changes, small updates in Sound and Texture2d loaders.
This commit is contained in:
@@ -47,6 +47,8 @@ public class TestGame : Game
|
||||
_uiLayer = new UiLayer();
|
||||
_worldLayer = new EntityLayer();
|
||||
|
||||
_testSoundInstance = _audioBackend!.CreateInstance(_testSound!);
|
||||
|
||||
Input.AddInputMapping("play", new InputAction[] { new KeyInputAction(KeyboardKey.Spacebar) });
|
||||
Input.AddInputMapping("sprint", new InputAction[] { new KeyInputAction(KeyboardKey.LeftShift) });
|
||||
Input.AddInputMapping("toggle_fullscreen", new InputAction[] { new KeyInputAction(KeyboardKey.F11) });
|
||||
@@ -64,6 +66,13 @@ public class TestGame : Game
|
||||
{
|
||||
while (_scene!.ShouldRun)
|
||||
{
|
||||
if (Input.IsActionPressed("play"))
|
||||
{
|
||||
_testSoundInstance!.PitchVariation(0.9f, 1.1f)
|
||||
.VolumeVariation(0.98f, 1.02f);
|
||||
|
||||
_testSoundInstance!.Play();
|
||||
}
|
||||
_scene.Update();
|
||||
_scene.BeginDraw();
|
||||
_scene.EndDraw();
|
||||
@@ -77,6 +86,7 @@ public class TestGame : Game
|
||||
}
|
||||
|
||||
private Sound? _testSound;
|
||||
private SoundInstance? _testSoundInstance;
|
||||
private Font? _font;
|
||||
private FmodAudioBackend? _audioBackend;
|
||||
private Scene? _scene;
|
||||
|
||||
Reference in New Issue
Block a user