/// <summary> /// 狀態切換 /// </summary> public void ChangeState(IAIState state) { currestState.Exit(); previousState = currestState; currestState = state; currestState.Enter(); }
public override void ChangeState(IAIState <SkeletonController> newState) { if (CurrentState != null) { CurrentState.Exit(); } //Enter new state CurrentState = newState; CurrentState.Enter(this); }
public override void ChangeState(IAIState <PhoenixController> newState) { //Exits old state if (CurrentState != null) { CurrentState.Exit(); } //Enters new CurrentState = newState; CurrentState.Enter(this); }
//Changes the current Ai state public void ChangeState(IAIState newState) { if (currentAIState != null) { //Runs the state exit code currentAIState.Exit(); } currentAIState = newState; //Do enter state code and send our self as the Enemy currentAIState.Enter(this); }
/// <summary> /// 設置當前狀態 /// </summary> public void SetCurrestState(IAIState state) { currestState = state; currestState.Enter(); if (currestState != null) { bcurrestState = true; } else { bcurrestState = false; } }