// Actions private void Fire() { if (revolvingBarrel.isOpen || !grabComponent.inHand) { return; } if (curBullets > 0) { curBullets--; fireBulletComponent.Fire(); grabComponent.EditGripForKick(kickForce); input.RumbleActiveController(0.25f); trigger.Rotate(1.0f); hammer.Rotate(1.0f); revolvingBarrel.Revolve(); } else { fireBulletComponent.DryFire(); input.RumbleActiveController(0.05f); trigger.Rotate(1.0f); hammer.Rotate(1.0f); revolvingBarrel.Revolve(); } }
// Update is called once per frame void Update () { if (grabbable.inHand && !inHand && hapticsOnGrab) { input.RumbleActiveController(vibrationLengthInSeconds); } inHand = grabbable.inHand; }