public virtual BTResult OnEnter(BTBlackBoard blackBoard) { if (m_cChild == null) { return(BTResult.Success); } return(m_cChild.OnTick(blackBoard)); }
sealed public override BTResult OnTick(BTBlackBoard blackBoard) { if (m_cChild != null) { return(m_cChild.OnTick(blackBoard)); } return(BTResult.Success); }
//如果子对象在running状态中,那么,下一帧直接执行 protected BTResult OnRunningChildTick(BTNode child, BTBlackBoard blackBoard) { BTResult result = child.OnTick(blackBoard); if (result == BTResult.Running) { m_cRunningChild = child; } else { m_cRunningChild = null; } return(result); }
public override BTResult OnTick(BTBlackBoard blackBoard) { FP deltaTime = blackBoard.deltaTime; if (m_bIsEnd) { m_bIsEnd = false; m_sTime = 0; m_nCount = 0; } int count = m_lstChild.Count; for (int i = 0; i < count; i++) { if (m_lstResults[i] == BTResult.Running) { BTNode child = m_lstChild[i]; IBTTimeLineNode timeLineNode = child as IBTTimeLineNode; if (timeLineNode.time <= m_sTime) { BTResult result = child.OnTick(blackBoard); if (result != BTResult.Running) { m_lstResults[i] = result; m_nCount++; } } } } m_sTime += deltaTime; if (m_nCount == count) { m_bIsEnd = true; return(BTResult.Success); } return(BTResult.Running); }
public virtual BTResult OnEnter(BTBlackBoard blackBoard) { return(m_cChild.OnTick(blackBoard)); }