Esempio n. 1
0
    void Update()
    {
        if (!lockPlayer)
        {
            gb.Spin(Input.GetAxis("Mouse X") * mouseSensitivityX, 0.1f);

            verticalLookRotation += Input.GetAxis("Mouse Y") * mouseSensitivityY * Time.deltaTime;
            verticalLookRotation  = Mathf.Clamp(verticalLookRotation, -verticalClampAngle, verticalClampAngle);
            cam.localEulerAngles  = Vector3.left * verticalLookRotation;

            if (Input.GetButton("Jump"))
            {
                gb.Boost(jumpPower);
            }

            if (Input.GetButton("Fire1"))
            {
                gun.FireGun(cam.transform.forward);
            }

            gb.Orbit(new Vector2(Input.GetAxis("Horizontal"), Input.GetAxis("Vertical")).normalized *speed);
        }
    }