Esempio n. 1
0
    // Update is called once per frame
    protected override void Update()
    {
        UpdateActions();
        if (mouseLook.isEnabled)
        {
            if (canMove)
            {
                UpdateMovement();
            }

            if (Input.GetMouseButtonDown(1))
            {
                if (holdingItem != null)
                {
                    GunBase holdingGun = holdingItem as GunBase;
                    if (holdingGun != null)
                    {
                        holdingGun.Zoom(crossHair);
                    }
                }
            }
            if (Input.GetMouseButtonUp(1))
            {
                Camera.main.fieldOfView = startFov;
                crossHair.ResetCrosshair();
                mouseLook.sensitivityX = 15;
                mouseLook.sensitivityY = 15;
            }
        }
        base.Update();
    }