fix: Duplicate Values on Behaviour Collector
This commit is contained in:
parent
55ed8b84f6
commit
85f0555c59
|
@ -68,11 +68,7 @@ public class BehaviourCollector<T> : IAssignableGameManager, IEnumerable<T>
|
|||
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<T> : IAssignableGameManager, IEnumerable<T>
|
|||
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;
|
||||
|
|
Loading…
Reference in New Issue