Beispiel #1
0
    void Start()
    {
        BehaviorTreeBuilder builder = new BehaviorTreeBuilder();

        builder.Sequence("sequence1");
        builder.Action("action1", Action01);
        builder.Action("action2", Action02);
        builder.Sequence("sequence02");
        builder.Action("action03", Action03);
        builder.Action("action04", Action04);
        builder.End();
        builder.Action("Action05", Action05);
        builder.Action("Action06", Action06);
        builder.End();
        tree = builder.Build();
    }
Beispiel #2
0
        protected override IBehaviorTreeNode createBehaviorTree()
        {
            BehaviorTreeBuilder builder = new BehaviorTreeBuilder();

            return(AIExtensions.WithFightingAI(
                       builder
                       .Sequence()

                       .End()
                       .Build(),
                       Entity
                       ));
        }
Beispiel #3
0
        protected override IBehaviorTreeNode createBehaviorTree()
        {
            BehaviorTreeBuilder builder = new BehaviorTreeBuilder();

            return(AIExtensions.WithFightingAI(
                       builder
                       .Sequence()
                       .LongRunningResultCached(() => new WaitTask(Entity, TimeSpan.FromMilliseconds(200)))
                       .LongRunningResultCached(() => new FollowTask(Entity, targetID, tillDistance, teleportDistance))
                       .End()
                       .Build(),
                       Entity
                       ));
        }
Beispiel #4
0
        protected override IBehaviorTreeNode createBehaviorTree()
        {
            BehaviorTreeBuilder builder = new BehaviorTreeBuilder();

            return(AIExtensions.WithFightingAI(
                       builder
                       .Sequence()
                       .LongRunningResultCached(() => new WaitTask(Entity, TimeSpan.FromMilliseconds(1000)))
                       .LongRunningResultCached(() => new WanderTask(Entity, BlockStartPosition, BlockRadius))
                       .End()
                       .Build(),
                       Entity
                       ));
        }
Beispiel #5
0
        protected override IBehaviorTreeNode createBehaviorTree()
        {
            BehaviorTreeBuilder builder = new BehaviorTreeBuilder();

            return(AIExtensions.WithFightingAI(
                       builder
                       .Sequence()
                       .LongRunningResultCached(() => new GoToTask(Entity, BlockGuardPosition))
                       .SingleStep((GameTime gameTime) => {
                Entity.Direction = LookDirection;

                return BehaviourTreeStatus.Success;
            })
                       .End()
                       .Build(),
                       Entity
                       ));
        }