fix: RotatableBehaviour Not Assigning KeyboardInputsBehaviour when It's Missing
This commit is contained in:
parent
bd9974f410
commit
7ed6c1e050
|
@ -1,7 +1,3 @@
|
||||||
using Microsoft.Xna.Framework;
|
|
||||||
|
|
||||||
using Apos.Shapes;
|
|
||||||
|
|
||||||
using Syntriax.Engine.Core;
|
using Syntriax.Engine.Core;
|
||||||
|
|
||||||
namespace Pong.Behaviours;
|
namespace Pong.Behaviours;
|
||||||
|
@ -12,8 +8,8 @@ public class RotatableBehaviour : BehaviourOverride
|
||||||
|
|
||||||
protected override void OnFirstActiveFrame()
|
protected override void OnFirstActiveFrame()
|
||||||
{
|
{
|
||||||
if (BehaviourController.TryGetBehaviour(out inputs))
|
if (!BehaviourController.TryGetBehaviour(out inputs))
|
||||||
inputs.BehaviourController.AddBehaviour<KeyboardInputsBehaviour>();
|
inputs = BehaviourController.AddBehaviour<KeyboardInputsBehaviour>();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnUpdate()
|
protected override void OnUpdate()
|
||||||
|
|
Loading…
Reference in New Issue