Beispiel #1
0
 void Locked()
 {
     transform.position = Player.position + Offset;
     if (Input.GetKeyUp(KeyCode.Space))
     {
         state = GameConsts.CAMERA_STATE.UNLOCKED;
     }
 }
Beispiel #2
0
    void Unlocked()
    {
        state = Input.GetKey(KeyCode.Space) ? GameConsts.CAMERA_STATE.LOCKED : GameConsts.CAMERA_STATE.UNLOCKED;



        CameraMove();
    }
Beispiel #3
0
    private void LateUpdate()
    {
        if (Input.GetKeyDown(KeyCode.Y))
        {
            state = state == GameConsts.CAMERA_STATE.LOCKED ? GameConsts.CAMERA_STATE.UNLOCKED : GameConsts.CAMERA_STATE.LOCKED;
        }


        switch (state)
        {
        case GameConsts.CAMERA_STATE.LOCKED:
        {
            Locked();
            break;
        }

        case GameConsts.CAMERA_STATE.UNLOCKED:
        {
            Unlocked();
            break;
        }
        }
    }