fix: behaviour controller initializing added behaviours when it itself is not initialized
This commit is contained in:
parent
4623b4861a
commit
c39ee44442
@ -29,6 +29,7 @@ public class BehaviourController : BaseEntity, IBehaviourController
|
|||||||
behaviour.Assign(this);
|
behaviour.Assign(this);
|
||||||
behaviour.Assign(Factory.StateEnableFactory.Instantiate(behaviour));
|
behaviour.Assign(Factory.StateEnableFactory.Instantiate(behaviour));
|
||||||
|
|
||||||
|
if (IsInitialized)
|
||||||
behaviour.Initialize();
|
behaviour.Initialize();
|
||||||
behaviour.OnPriorityChanged += OnPriorityChange;
|
behaviour.OnPriorityChanged += OnPriorityChange;
|
||||||
OnBehaviourAdded?.InvokeSafe(this, behaviour);
|
OnBehaviourAdded?.InvokeSafe(this, behaviour);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user