diff --git a/Engine.Core/HierarchyObject.cs b/Engine.Core/HierarchyObject.cs index 87316f8..e617ede 100644 --- a/Engine.Core/HierarchyObject.cs +++ b/Engine.Core/HierarchyObject.cs @@ -108,13 +108,13 @@ public class HierarchyObject : BaseEntity, IHierarchyObject OnChildrenAdded?.Invoke(this, parent); } - public void RemoveChild(IHierarchyObject parent) + public void RemoveChild(IHierarchyObject child) { - if (!_children.Remove(parent)) + if (!_children.Remove(child)) return; - parent.SetParent(null); - OnChildrenRemoved?.Invoke(this, parent); + child.SetParent(null); + OnChildrenRemoved?.Invoke(this, child); } protected virtual void OnAssign(IBehaviourController behaviourController) { }