feat: OnFirstActiveFrame of Engine.Core

This commit is contained in:
Syntriax 2023-11-30 10:49:11 +03:00
parent bbc15cba92
commit 9ec92c1beb
2 changed files with 2 additions and 2 deletions

2
Engine

@ -1 +1 @@
Subproject commit d2881e94df2796174795e5ef04b057ac6580bda3 Subproject commit bb6990a80c499a93de9c23be7c8821d66c4c3377

View File

@ -32,7 +32,7 @@ public class MovementBoxBehaviour(Keys Up, Keys Down, float High, float Low, flo
GameObject.Transform.Position = new Vector2(GameObject.Transform.Position.X, MathF.Max(MathF.Min(GameObject.Transform.Position.Y, High), Low)); GameObject.Transform.Position = new Vector2(GameObject.Transform.Position.X, MathF.Max(MathF.Min(GameObject.Transform.Position.Y, High), Low));
} }
protected override void OnInitialize() protected override void OnFirstActiveFrame(GameTime time)
{ {
if (!BehaviourController.TryGetBehaviour<IKeyboardInputs>(out var behaviourResult)) if (!BehaviourController.TryGetBehaviour<IKeyboardInputs>(out var behaviourResult))
throw new Exception($"{nameof(IKeyboardInputs)} is missing on ${GameObject.Name}."); throw new Exception($"{nameof(IKeyboardInputs)} is missing on ${GameObject.Name}.");