fix: removing an object from hierarchy setting all children's parents null
This commit is contained in:
@@ -220,7 +220,6 @@ public class Transform2D : Behaviour, ITransform2D
|
||||
ITransform2D? previousParent = parentTransform;
|
||||
if (previousParent is not null)
|
||||
{
|
||||
previousParent.BehaviourController.HierarchyObject.RemoveChild(HierarchyObject);
|
||||
previousParent.OnPositionChanged -= RecalculatePosition;
|
||||
previousParent.OnScaleChanged -= RecalculateScale;
|
||||
previousParent.OnRotationChanged -= RecalculateRotation;
|
||||
@@ -232,7 +231,6 @@ public class Transform2D : Behaviour, ITransform2D
|
||||
|
||||
if (parentTransform is not null)
|
||||
{
|
||||
parentTransform.BehaviourController.HierarchyObject.AddChild(HierarchyObject);
|
||||
parentTransform.OnPositionChanged += RecalculatePosition;
|
||||
parentTransform.OnScaleChanged += RecalculateScale;
|
||||
parentTransform.OnRotationChanged += RecalculateRotation;
|
||||
|
Reference in New Issue
Block a user