Exemplo n.º 1
0
        public override ResultType Execute(BInput _input)
        {
            TargetInput input = _input as TargetInput;

            input.Target.SetProperty("hp", 100);
            GameInput.DebugLog("do action atk");
            state = State.Exit;
            return(ResultType.Success);
        }
Exemplo n.º 2
0
 public virtual ResultType Execute(BInput _input)
 {
     GameInput.DebugLog("base node execute " + _input);
     state = State.Running;
     if (listChilds.Count > 0)
     {
         Node node = listChilds[0];
         node.Execute(_input);
     }
     return(ResultType.None);
 }
Exemplo n.º 3
0
 public override void DoUpdate()
 {
     if (state == State.Running)
     {
         Node _node;
         _node = listChilds[_currentIndex];
         if (_node.state == State.Exit)
         {
             _currentIndex++;
             if (_currentIndex == listChilds.Count)
             {
                 state = State.Exit;
                 GameInput.DebugLog("sequence end");
                 return;
             }
             listChilds[_currentIndex].RunNode(_input);
         }
     }
 }
Exemplo n.º 4
0
        public override ResultType Execute(BInput _input)
        {
            if (_currentIndex >= listChilds.Count)
            {
                GameInput.DebugLog("没有找到匹配这个条件的");
                return(ResultType.Fail);
            }

            Node _node = listChilds[_currentIndex];

            if (_node.Evaluate(_input))
            {
                return(result = _node.RunNode(_input));
            }
            else
            {
                _currentIndex++;
                Execute(_input);
            }
            result = ResultType.Running;
            return(result);
        }
Exemplo n.º 5
0
 protected virtual void Enter()
 {
     GameInput.DebugLog("node enter : " + nodeName);
     state = State.Enter;
 }
Exemplo n.º 6
0
 public void LoadActionConfig()
 {
     GameInput.DebugLog("load action config");
 }
Exemplo n.º 7
0
 public override ResultType Execute(BInput _input)
 {
     GameInput.DebugLog("do action idle");
     state = State.Exit;
     return(ResultType.Success);
 }