コード例 #1
0
ファイル: TestTree.cs プロジェクト: zhaoyabo/GameBase
        private void Init()
        {
            //_selectorNode = new SelectorNode();
            //_selectorNode = new SequenceNode();
            _selectorNode = new ParallelNode();
            ParallelNode _subParallel = new ParallelNode();

            _actionAtk = new ActionAtk();
            _actionAtk.SetPreCondition(new ActionAtkPreCondition());
            _selectorNode.AddChild(new ActionIdle());
            _selectorNode.AddChild(_actionAtk);

            TargetInput _input = new TargetInput();
            _input.Target = GlobalData.hero.MyEnity;
            _input.state = 1;
            _selectorNode.RunNode(_input);
            GameInput.Instance.OnUpdate += _selectorNode.Update;
        }
コード例 #2
0
        private void Init()
        {
            //_selectorNode = new SelectorNode();
            //_selectorNode = new SequenceNode();
            _selectorNode = new ParallelNode();
            ParallelNode _subParallel = new ParallelNode();

            _actionAtk = new ActionAtk();
            _actionAtk.SetPreCondition(new ActionAtkPreCondition());
            _selectorNode.AddChild(new ActionIdle());
            _selectorNode.AddChild(_actionAtk);

            TargetInput _input = new TargetInput();

            _input.Target = GlobalData.hero.MyEnity;
            _input.state  = 1;
            _selectorNode.RunNode(_input);
            GameInput.Instance.OnUpdate += _selectorNode.Update;
        }