From fb402acc30571ae54adde5882d85eca4b9345126 Mon Sep 17 00:00:00 2001 From: Syntriax Date: Sat, 5 Oct 2024 23:08:44 +0300 Subject: [PATCH] fix: BehaviourCollector Skipping Unregistered GameObjects --- Engine.Core/BehaviourCollector.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Engine.Core/BehaviourCollector.cs b/Engine.Core/BehaviourCollector.cs index 512b0cc..a0661df 100644 --- a/Engine.Core/BehaviourCollector.cs +++ b/Engine.Core/BehaviourCollector.cs @@ -34,6 +34,9 @@ public class BehaviourCollector : IAssignableGameManager, IEnumerable { 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)