public BehaviourTreeBuilder ConnectTree(BehaviourTreeBuilder treePart) { BehaviourTreeNode child = treePart.Build(); if (this.root == null) { this.root = child; return(this); } this.AddChild(child); return(this); }
public BehaviourTreeBuilder StartParallel() { ParallelNode node = new ParallelNode(); if (this.root == null) { this.root = node; this.builderStack.Push(node); return(this); } this.AddChild(node); this.builderStack.Push(node); return(this); }
private void AddChild(BehaviourTreeNode child) { object obj2 = this.builderStack.Peek(); if (ReferenceEquals(obj2.GetType().BaseType, typeof(CompositeNode))) { (obj2 as CompositeNode).AddChild(child); } if (ReferenceEquals(obj2.GetType().BaseType, typeof(DecoratorNode))) { (obj2 as DecoratorNode).AddChild(child); this.builderStack.Pop(); } }
public BehaviourTreeBuilder StartSequence() { SequenceNode node = new SequenceNode(); if (this.root == null) { this.root = node; this.builderStack.Push(node); return(this); } this.AddChild(node); this.builderStack.Push(node); return(this); }
public BehaviourTreeBuilder StartPreconditionSequence() { PreconditionSequence sequence = new PreconditionSequence(); if (this.root == null) { this.root = sequence; this.builderStack.Push(sequence); return(this); } this.AddChild(sequence); this.builderStack.Push(sequence); return(this); }
public BehaviourTreeBuilder StartDoOnceIn(float time) { OnceInTimeNode node = new OnceInTimeNode { Time = time }; if (this.root == null) { this.root = node; this.builderStack.Push(node); return(this); } this.AddChild(node); this.builderStack.Push(node); return(this); }
public void AddChild(BehaviourTreeNode child) { this.Child = child; }
public void AddChild(BehaviourTreeNode child) { this.children.Add(child); }