/// <summary> /// 状態切替 /// </summary> public void SwitchState(IGameState state) { // コンポーネントの有効無効の切り替えを行う // または。アクションをUpdateで行う CurrentState = null; CurrentState = state; if (CurrentState != null) { CurrentState.Action(); } }
public void Action() { state.Action(); }