public void SetState(CameraState newState)
 {
     if (state != null)
     {
         state.OnStateExit();
     }
     state = newState;
     if (state != null)
     {
         state.OnStateEnter();
     }
 }
Beispiel #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();
        }
    }
Beispiel #3
0
    public void SetState(CameraState state)
    {
        if (currentState != null)
        {
            currentState.OnStateExit();
        }

        currentState = state;

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