// Use this for initialization void Start () { var builder = new bt.TreeBuilder (); builder .AddSequence () .Begin () // .AddNode(null) .AddSequence () .Begin () //.AddAction(new AlwaysFails()) .AddSequence() //.AddAction(new UseScript()) .AddSequence() .End() .AddSequence () //.AddAction (null) // .AddDecorator (null) // .AddSelector (null) // .Begin () // .AddAction (null) // .AddAction (null) // .End () .End (); localPlan = builder.Build(); //Debug.Log("Start"); }
// Use this for initialization void Start() { var builder = new bt.TreeBuilder(); builder .AddSequence() .Begin() // .AddNode(null) .AddSequence() .Begin() //.AddAction(new AlwaysFails()) .AddSequence() //.AddAction(new UseScript()) .AddSequence() .End() .AddSequence() //.AddAction (null) // .AddDecorator (null) // .AddSelector (null) // .Begin () // .AddAction (null) // .AddAction (null) // .End () .End(); localPlan = builder.Build(); //Debug.Log("Start"); }
public static void Main(string[] args) { var builder = new bt.TreeBuilder(); builder .Sequence() .Begin() // .AddNode(null) .Sequence() .Begin() //.AddAction(new AlwaysFails()) .Sequence() //.AddAction(new UseScript()) .Sequence() .End() .Sequence() //.AddAction (null) // .AddDecorator (null) // .AddSelector (null) // .Begin () // .AddAction (null) // .AddAction (null) // .End () .End(); var localPlan = builder.Build(); var builder2 = new bt.TreeBuilder(); builder2 .Sequence() .Begin() .AddTree(localPlan) .Parallel() .End(); Console.WriteLine("SECOND PLAN"); var secondPlan = builder2.Build(); var walk = new bt.NodeWalker(); walk.Initialise(secondPlan.Root); // Debug.Log("Root"); walk.ComputeAllSteps(); }
public static void Main (string[] args) { var builder = new bt.TreeBuilder (); builder .Sequence () .Begin () // .AddNode(null) .Sequence () .Begin () //.AddAction(new AlwaysFails()) .Sequence() //.AddAction(new UseScript()) .Sequence() .End() .Sequence () //.AddAction (null) // .AddDecorator (null) // .AddSelector (null) // .Begin () // .AddAction (null) // .AddAction (null) // .End () .End (); var localPlan = builder.Build(); var builder2 = new bt.TreeBuilder(); builder2 .Sequence() .Begin() .AddTree(localPlan) .Parallel() .End(); Console.WriteLine("SECOND PLAN"); var secondPlan = builder2.Build(); var walk = new bt.NodeWalker (); walk.Initialise(secondPlan.Root); // Debug.Log("Root"); walk.ComputeAllSteps (); }