public void SetState(CameraState newState)
 {
     if (state != null)
     {
         state.OnStateExit();
     }
     state = newState;
     if (state != null)
     {
         state.OnStateEnter();
     }
 }
示例#2
0
    public void SetState(CameraState state)
    {
        if (currentState != null)
        {
            currentState.OnStateExit();
        }

        currentState    = state;
        gameObject.name = "Camera - " + state.GetType().Name;

        if (currentState != null)
        {
            currentState.OnStateEnter();
        }
    }
示例#3
0
    public void SetState(CameraState state)
    {
        if (currentState != null)
        {
            currentState.OnStateExit();
        }

        currentState = state;

        if (currentState != null)
        {
            currentState.Init();
            currentState.OnStateEnter();
        }
    }