Example #1
0
    protected Node ST_SelectStory(StoryID id)
    {
        switch (id)
        {
        case StoryID.mainstoryarc:


            Node SelectmainStory = new SelectorParallel(
                new DecoratorInvert(new DecoratorLoop(new DecoratorInvert(new LeafAssert(() => currentStoryID != id)))),
                this.ST_MainStoryArc());

            return(SelectmainStory);

        case StoryID.freeAdam1:


            Node SelectfreeAdam1 = new SelectorParallel(
                new DecoratorInvert(new DecoratorLoop(new DecoratorInvert(new LeafAssert(() => currentStoryID != id)))),
                this.ST_freeAdam1());

            return(SelectfreeAdam1);

        default:
            return(null);
        }
    }
Example #2
0
    /// <summary>
    /// Has to be an interactive behavior tree if you want to control agent
    /// </summary>
    /// <returns></returns>
    protected Node BuildTreeRoot()
    {
        Node InteractiveBehaviorTreeRoot =
            new SelectorParallel(
                this.ST_Story(),
                this.ST_MonitorStoryState()
                );


        return(InteractiveBehaviorTreeRoot);
    }
Example #3
0
    protected Node SelP_AntagonistEvaluate() // Evaluate antagonists' current situation.
    {
        Node antagonistEvaluate = new SelectorParallel(
            new DecoratorLoop(
                this.Pursue()
                ),
            new DecoratorLoop(
                this.AntagonistAttack()
                ));

        return(antagonistEvaluate);
    }
Example #4
0
    protected Node BuildTreeRoot()
    {
        Val <Vector3> pos1 = Val.V(() => p1.position);
        Val <Vector3> pos2 = Val.V(() => p2.position);
        Val <Vector3> pos3 = Val.V(() => p3.position);

        //Val<Vector3> face = Val.V (() => participant3.transform.position);
        Node setup = new Sequence
                     (

            new SequenceParallel(
                part1.Node_GoTo(pos1),
                part2.Node_GoTo(pos2),
                part3.Node_GoTo(pos3) //,
                //Player.GetComponent<BehaviorMecanim>().Node_GoTo(Player.transform.position)
                ),

            new LeafWait(500),

            this.pointOthers(participant1, participant2, participant3)

                     );



        Node root = new SelectorParallel(
            setup,
            this.Simplify(participant1, participant2, participant3)
            );


        Val <Vector3> face1 = Val.V(() => participant4.transform.position);
        Val <Vector3> face2 = Val.V(() => participant1.transform.position);

        //Node root = new Sequence(part1.Node_OrientTowards(face1), participant4.GetComponent<BehaviorMecanim>().Node_OrientTowards(face2));
        return(root);
    }