InputSystem optimizations and changes.

This commit is contained in:
2024-10-21 19:18:37 +02:00
parent 07224d684d
commit 64d72cc053
4 changed files with 106 additions and 115 deletions

View File

@@ -43,17 +43,12 @@ public class TestGame : Game
protected override void Ready()
{
Input.AddInputMapping("reload", new InputAction[] { new KeyInputAction(KeyboardKey.R) });
Input.AddInputMapping("reload", new IInputAction[] { new KeyInputAction(KeyboardKey.R) });
_emitterId = _particleSystem.CreateEmitter(Renderer.WindowSize / 2, _fireEffect);
}
protected override void Update(double deltaTime)
{
}
protected override void Render(double deltaTime)
{
if (Input.IsActionPressed("reload"))
{
@@ -70,7 +65,10 @@ public class TestGame : Game
{
_particleSystem.SetEmitterPosition(_emitterId, Input.GetMousePosition());
}
}
protected override void Render(double deltaTime)
{
Renderer.ClearBackground(Color.Black);
foreach (var emitter in _particleSystem!.Emitters)
{