예제 #1
0
        sealed public override BTResult Tick()
        {
            BTResult tickResult = BTResult.Success;

            if (_status == BTActionStatus.Ready)
            {
                Enter();
                _status = BTActionStatus.Running;
            }
            if (_status == BTActionStatus.Running)
            {
                tickResult = Execute();
                if (tickResult != BTResult.Running)
                {
                    Exit();
                    _status   = BTActionStatus.Ready;
                    isRunning = false;
                }
                else
                {
                    isRunning = true;
                }
            }
            return(tickResult);
        }
예제 #2
0
파일: BTAction.cs 프로젝트: zs9024/BTtree
		public override void Clear () {
			base.Clear();

			if (_status != BTActionStatus.Ready) {	// not cleared yet
				Exit();
				_status = BTActionStatus.Ready;
			}
		}
예제 #3
0
 public override void Clear()
 {
     if (_status != BTActionStatus.Ready)                // not cleared yet
     {
         Exit();
         _status = BTActionStatus.Ready;
     }
 }
예제 #4
0
 public override void Clear()
 {
     if (status != BTActionStatus.Ready)
     {
         // 还未清除
         Exit();
         status = BTActionStatus.Ready;
     }
 }
예제 #5
0
		public override BTResult Tick () {
			BTResult result = BTResult.Ended;
			if (_status == BTActionStatus.Ready) {
				Enter();
				_status = BTActionStatus.Running;
			}
			if (_status == BTActionStatus.Running) {		// not using else so that the status changes reflect instantly
				result = Execute();
				if (result != BTResult.Running) {
					Exit();
					_status = BTActionStatus.Ready;
				}
			}
			return result;
		}
예제 #6
0
파일: BTAction.cs 프로젝트: zs9024/BTtree
		sealed public override BTResult Tick () {
			BTResult tickResult = BTResult.Success;

			if (_status == BTActionStatus.Ready) {
				Enter();
				_status = BTActionStatus.Running;
			}
			if (_status == BTActionStatus.Running) {
				tickResult = Execute();
				if (tickResult != BTResult.Running) {
					Exit();
					_status = BTActionStatus.Ready;
					isRunning = false;
				}
				else {
					isRunning = true;
				}
			}
			return tickResult;
		}
예제 #7
0
    public override BTResult Tick()
    {
        BTResult result = BTResult.Ended;

        if (_currentStatus == BTActionStatus.Ready)
        {
            Enter();
            _currentStatus = BTActionStatus.Running;
        }
        else if (_currentStatus == BTActionStatus.Running)
        {
            result = Excute();
            if (result == BTResult.Ended)
            {
                Exit();
                _currentStatus = BTActionStatus.Ready;
            }
        }
        return(result);
    }
예제 #8
0
        public override BTResult Tick()
        {
            BTResult result = BTResult.Ended;

            if (_status == BTActionStatus.Ready)
            {
                Enter();
                _status = BTActionStatus.Running;
            }
            if (_status == BTActionStatus.Running)                              // not using else so that the status changes reflect instantly
            {
                result = Execute();
                if (result != BTResult.Running)
                {
                    Exit();
                    _status = BTActionStatus.Ready;
                }
            }
            return(result);
        }
예제 #9
0
    public override BTResult Tick()
    {
        BTResult result = BTResult.Ended;

        if (status == BTActionStatus.Ready)
        {
            Enter();
            status = BTActionStatus.Running;
        }

        if (status == BTActionStatus.Running)
        {
            result = Execute();
            if (result != BTResult.Running)
            {
                Exit();
                // 返回默认状态
                status = BTActionStatus.Ready;
            }
        }
        return(result);
    }