fix: behaviour controller initializing added behaviours when it itself is not initialized
This commit is contained in:
parent
4623b4861a
commit
c39ee44442
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user