/// <summary> /// Set the parent of this BehaviourNode /// </summary> public virtual void SetParent(BehaviourParentNode parent) { if (parent != null) { if (parent.Type == NodeType.TASK) { throw new System.Exception("Tasks don`t have children"); } } this.Parent = parent; }
/// <summary> /// Set the parent of this BehaviourNode /// </summary> public override void SetParent(BehaviourParentNode parent) { base.SetParent(parent); this.Parent?.AddChild(this); }
// To Refactor public override void SetParent(BehaviourParentNode parent) { throw new System.Exception("Root nodes cannot have parents"); }