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;
|
||||
|
||||
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()
|
||||
|
|
Loading…
Reference in New Issue