chore: removed unused code piece from HierarchyObject
This commit is contained in:
parent
c71bf71fb3
commit
5756b96002
@ -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)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user