From c39ee444424c7f45ca6eb4441e19800505092eba Mon Sep 17 00:00:00 2001 From: Syntriax Date: Fri, 25 Apr 2025 21:54:05 +0300 Subject: [PATCH] fix: behaviour controller initializing added behaviours when it itself is not initialized --- Engine.Core/BehaviourController.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Engine.Core/BehaviourController.cs b/Engine.Core/BehaviourController.cs index b1f174d..a5d7ae1 100644 --- a/Engine.Core/BehaviourController.cs +++ b/Engine.Core/BehaviourController.cs @@ -29,7 +29,8 @@ public class BehaviourController : BaseEntity, IBehaviourController behaviour.Assign(this); behaviour.Assign(Factory.StateEnableFactory.Instantiate(behaviour)); - behaviour.Initialize(); + if (IsInitialized) + behaviour.Initialize(); behaviour.OnPriorityChanged += OnPriorityChange; OnBehaviourAdded?.InvokeSafe(this, behaviour); return behaviour;