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;
|
return false;
|
||||||
|
|
||||||
foreach (IGameObject gameObject in gameManager)
|
foreach (IGameObject gameObject in gameManager)
|
||||||
{
|
|
||||||
OnGameObjectRegistered(gameManager, gameObject);
|
OnGameObjectRegistered(gameManager, gameObject);
|
||||||
foreach (IBehaviour behaviour in gameObject.BehaviourController)
|
|
||||||
OnBehaviourAdded(gameObject.BehaviourController, behaviour);
|
|
||||||
}
|
|
||||||
|
|
||||||
gameManager.OnGameObjectRegistered += OnGameObjectRegistered;
|
gameManager.OnGameObjectRegistered += OnGameObjectRegistered;
|
||||||
gameManager.OnGameObjectUnRegistered += OnGameObjectUnregistered;
|
gameManager.OnGameObjectUnRegistered += OnGameObjectUnregistered;
|
||||||
|
@ -89,11 +85,7 @@ public class BehaviourCollector<T> : IAssignableGameManager, IEnumerable<T>
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
foreach (IGameObject gameObject in GameManager)
|
foreach (IGameObject gameObject in GameManager)
|
||||||
{
|
|
||||||
OnGameObjectUnregistered(GameManager, gameObject);
|
OnGameObjectUnregistered(GameManager, gameObject);
|
||||||
foreach (IBehaviour behaviour in gameObject.BehaviourController)
|
|
||||||
OnBehaviourRemoved(gameObject.BehaviourController, behaviour);
|
|
||||||
}
|
|
||||||
|
|
||||||
GameManager.OnGameObjectRegistered -= OnGameObjectRegistered;
|
GameManager.OnGameObjectRegistered -= OnGameObjectRegistered;
|
||||||
GameManager.OnGameObjectUnRegistered -= OnGameObjectUnregistered;
|
GameManager.OnGameObjectUnRegistered -= OnGameObjectUnregistered;
|
||||||
|
|
Loading…
Reference in New Issue