diff --git a/Engine.Core/HierarchyObject.cs b/Engine.Core/HierarchyObject.cs index 2eecd4c..93dab51 100644 --- a/Engine.Core/HierarchyObject.cs +++ b/Engine.Core/HierarchyObject.cs @@ -77,7 +77,6 @@ public class HierarchyObject : BaseEntity, IHierarchyObject if (previousParent is not null) { previousParent.RemoveChild(this); - previousParent.OnParentChanged -= NotifyChildrenOnParentChange; previousParent.OnActiveChanged -= OnParentActiveChanged; } @@ -86,7 +85,6 @@ public class HierarchyObject : BaseEntity, IHierarchyObject if (parent is not null) { parent.AddChild(this); - parent.OnParentChanged += NotifyChildrenOnParentChange; parent.OnActiveChanged += OnParentActiveChanged; } @@ -113,14 +111,6 @@ public class HierarchyObject : BaseEntity, IHierarchyObject OnChildrenRemoved?.Invoke(this, parent); } - private void NotifyChildrenOnParentChange(IHierarchyObject sender, IHierarchyObject? previousParent, IHierarchyObject? newParent) - { - // TODO No idea how logical this is to propagate this to the children the way I'm doing right now. - // I was originally gonna just call `child.OnParentChanged?.Invoke(child, child.parentTransform);` but seems an unnecessary call too? - foreach (IHierarchyObject child in Children) // TODO CHECK ERRORS - child.SetParent(this); - } - protected virtual void OnAssign(IBehaviourController behaviourController) { } public bool Assign(IBehaviourController behaviourController) {