Beispiel #1
0
    void PlayerControl()
    {
        bool doCameraUpdate2 = false;

        if (inputMouseX != 0)
        {
            transform.Rotate(0, turningSpeed * inputMouseX * Time.deltaTime, 0);
            doCameraUpdate2 = true;
        }

        if (cameraController.Move(inputMouseY, doCameraUpdate2))
        {
            doCameraUpdate = false;
        }

        if (GetQ() && controller.isGrounded)
        {
            checkpoint = transform.position;
        }
        else if (GetE())
        {
            transform.position = checkpoint;
            doCameraUpdate     = true;
        }
    }