chore: updated engine

This commit is contained in:
2025-04-13 22:24:56 +03:00
parent 51854a3e59
commit 34aa4dbb69
13 changed files with 91 additions and 91 deletions

View File

@@ -72,8 +72,8 @@ public class KeyboardInputsBehaviour : Behaviour, IButtonInputs<Keys>
if (WasPressed(currentlyPressedKey))
continue;
action.Invoke(this, currentlyPressedKey);
OnAnyButtonPressed?.Invoke(this, currentlyPressedKey);
action.InvokeSafe(this, currentlyPressedKey);
OnAnyButtonPressed?.InvokeSafe(this, currentlyPressedKey);
}
for (int i = 0; i < cachePressedPreviouslyCount; i++)
@@ -86,8 +86,8 @@ public class KeyboardInputsBehaviour : Behaviour, IButtonInputs<Keys>
if (IsPressed(previouslyPressedKey))
continue;
action.Invoke(this, previouslyPressedKey);
OnAnyButtonReleased?.Invoke(this, previouslyPressedKey);
action.InvokeSafe(this, previouslyPressedKey);
OnAnyButtonReleased?.InvokeSafe(this, previouslyPressedKey);
}
Array.Copy(cachePressedCurrently, cachePressedPreviously, cachePressedCurrentlyCount);

View File

@@ -1,7 +1,7 @@
using Pong.Platforms.Desktop;
using Syntriax.Engine.Core;
Syntriax.Engine.Core.Abstract.IHierarchyObject hierarchyObject = Syntriax.Engine.Core.Factory.HierarchyObjectFactory.Instantiate().SetHierarchyObject("Desktop HO");
hierarchyObject.BehaviourController.AddBehaviour<KeyboardInputsBehaviour>();
using var game = new Pong.GamePong(hierarchyObject);
Syntriax.Engine.Core.Abstract.IUniverseObject universeObject = Syntriax.Engine.Core.Factory.UniverseObjectFactory.Instantiate().SetUniverseObject("Desktop HO");
universeObject.BehaviourController.AddBehaviour<KeyboardInputsBehaviour>();
using var game = new Pong.GamePong(universeObject);
game.Run();