/// <summary> /// DANGER! /// Directly sets the child (at its relative index. /// This is used to help clone nodes. /// </summary> /// <param name="child"></param> public sealed override void ForceSetChild(BehaviourNode child) { child.ClearParent(); child.Parent = this; // Do not bother with unsetting the original child's parent. // The original child is already properly setup in its tree. // This is used when trying to build a tree copy, so we can // simply set a new child at that index. _children[child.ChildOrder] = child; }
/// <summary> /// DANGER! /// Directly sets the child. /// This is used to help clone nodes. /// </summary> /// <param name="child"></param> public sealed override void ForceSetChild(BehaviourNode child) { child.ClearParent(); // Do not bother with unsetting the original child's parent. // The original child is already properly setup in its tree. // This is used when trying to build a tree copy, so we can // simply null the reference and set a new child. _child = null; AddChild(child); }