/// <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;
        }
Example #2
0
 /// <summary>
 /// Set the parent of this BehaviourNode
 /// </summary>
 public override void SetParent(BehaviourParentNode parent)
 {
     base.SetParent(parent);
     this.Parent?.AddChild(this);
 }
Example #3
0
 // To Refactor
 public override void SetParent(BehaviourParentNode parent)
 {
     throw new System.Exception("Root nodes cannot have parents");
 }