コード例 #1
0
    // 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();
        }
    }
コード例 #2
0
	// Update is called once per frame
	void Update () {
		if (grabbable.inHand && !inHand && hapticsOnGrab) {
            input.RumbleActiveController(vibrationLengthInSeconds);
        }

        inHand = grabbable.inHand;

    }