fix: RotatableBehaviour Not Assigning KeyboardInputsBehaviour when It's Missing

This commit is contained in:
Syntriax 2024-01-27 14:47:29 +03:00
parent bd9974f410
commit 7ed6c1e050
1 changed files with 2 additions and 6 deletions

View File

@ -1,7 +1,3 @@
using Microsoft.Xna.Framework;
using Apos.Shapes;
using Syntriax.Engine.Core;
namespace Pong.Behaviours;
@ -12,8 +8,8 @@ public class RotatableBehaviour : BehaviourOverride
protected override void OnFirstActiveFrame()
{
if (BehaviourController.TryGetBehaviour(out inputs))
inputs.BehaviourController.AddBehaviour<KeyboardInputsBehaviour>();
if (!BehaviourController.TryGetBehaviour(out inputs))
inputs = BehaviourController.AddBehaviour<KeyboardInputsBehaviour>();
}
protected override void OnUpdate()