示例#1
0
    void BuildTree()
    {
        var rootRepeat       = new NaiveRepeater("rootRepeat", bt);
        var rootSel          = new SelectorNode("rootSel", bt);
        var parry            = new ActionNode("parry", Parry, bt);
        var counter          = new ActionNode("counter", Counter, bt);
        var defendSeq        = new SequenceNode("defendSeq", bt);
        var attackAndRecover = new ActionNode("attackAndRecover", AttackAndRecover, bt);
        var attacked         = new ActionNode("attacked", Attacked, bt);
        var dashSel          = new SelectorNode("dashSel", bt);
        var back             = new ActionNode("back", Back, bt);
        var attackSeq        = new SequenceNode("attackSeq", bt);

        rootRepeat.Build(
            rootSel.Build(
                defendSeq.Build(
                    parry,
                    counter
                    ),
                attackSeq.Build(
                    dashSel.Build(
                        attackAndRecover,
                        attacked
                        ),
                    back
                    )
                )
            );

        bt.Build(rootRepeat);
    }