コード例 #1
0
    /// <summary>
    /// 状態切替
    /// </summary>
    public void SwitchState(IGameState state)
    {
        // コンポーネントの有効無効の切り替えを行う
        // または。アクションをUpdateで行う

        CurrentState = null;
        CurrentState = state;

        if (CurrentState != null)
        {
            CurrentState.Action();
        }
    }
コード例 #2
0
 public void Action()
 {
     state.Action();
 }