From 85f0555c595a67134c033d96a06515b0d5c3a131 Mon Sep 17 00:00:00 2001 From: Syntriax Date: Sun, 3 Nov 2024 20:31:51 +0300 Subject: [PATCH] fix: Duplicate Values on Behaviour Collector --- Engine.Core/BehaviourCollector.cs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/Engine.Core/BehaviourCollector.cs b/Engine.Core/BehaviourCollector.cs index bd6e562..7fbc470 100644 --- a/Engine.Core/BehaviourCollector.cs +++ b/Engine.Core/BehaviourCollector.cs @@ -68,11 +68,7 @@ public class BehaviourCollector : IAssignableGameManager, IEnumerable return false; foreach (IGameObject gameObject in gameManager) - { OnGameObjectRegistered(gameManager, gameObject); - foreach (IBehaviour behaviour in gameObject.BehaviourController) - OnBehaviourAdded(gameObject.BehaviourController, behaviour); - } gameManager.OnGameObjectRegistered += OnGameObjectRegistered; gameManager.OnGameObjectUnRegistered += OnGameObjectUnregistered; @@ -89,11 +85,7 @@ public class BehaviourCollector : IAssignableGameManager, IEnumerable return false; foreach (IGameObject gameObject in GameManager) - { OnGameObjectUnregistered(GameManager, gameObject); - foreach (IBehaviour behaviour in gameObject.BehaviourController) - OnBehaviourRemoved(gameObject.BehaviourController, behaviour); - } GameManager.OnGameObjectRegistered -= OnGameObjectRegistered; GameManager.OnGameObjectUnRegistered -= OnGameObjectUnregistered;