public void Update() { //currentState.Reason(this); //currentState.Action(this); if (currentState != null) { //当前状态下的行为 currentState.Action(this); //当前状态下转换条件的检测 currentState.Reason(this); } }
public void OnUpdate(GameObject npc) { currentState.Action(npc); currentState.Reason(npc); }