fix: BehaviourCollector Skipping Unregistered GameObjects
This commit is contained in:
parent
923b25e26e
commit
fb402acc30
|
@ -34,6 +34,9 @@ public class BehaviourCollector<T> : IAssignableGameManager, IEnumerable<T>
|
|||
{
|
||||
gameObject.BehaviourController.OnBehaviourAdded -= OnBehaviourAdded;
|
||||
gameObject.BehaviourController.OnBehaviourRemoved -= OnBehaviourRemoved;
|
||||
|
||||
foreach (IBehaviour item in gameObject.BehaviourController)
|
||||
OnBehaviourRemoved(gameObject.BehaviourController, item);
|
||||
}
|
||||
|
||||
private void OnBehaviourAdded(IBehaviourController controller, IBehaviour behaviour)
|
||||
|
|
Loading…
Reference in New Issue