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); }
public override void Clear () { base.Clear(); if (_status != BTActionStatus.Ready) { // not cleared yet Exit(); _status = BTActionStatus.Ready; } }
public override void Clear() { if (_status != BTActionStatus.Ready) // not cleared yet { Exit(); _status = BTActionStatus.Ready; } }
public override void Clear() { if (status != BTActionStatus.Ready) { // 还未清除 Exit(); status = BTActionStatus.Ready; } }
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; }
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; }
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); }
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); }
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); }