public override void OnGrab(BlasterGrappler grappler) { // base.OnGrab(grappler); m_delegateTargetPickupPosition = rb.transform.position; parentFSM.TransitionTo(parentFSM.ragdollState); parentFSM.ragdollState.OnGrab(); }
public virtual void OnGrab(BlasterGrappler grappler) { isGrabbed = true; m_pickupPosition = transform.position; rb.useGravity = false; onGrab.Invoke(); }
public virtual void OnRelease(BlasterGrappler grappler) { isGrabbed = false; // This caused an exception with limb grabbing, not sure why if (rb != null) { rb.useGravity = true; } onRelease.Invoke(); }
// TODO: // - Alt fire mode when the rear handle is held // - How to avoid triggering damage multiple times when multiple limbs are hit? void Start() { parentHand = GetComponentInParent <Hand>(); grappler = GetComponent <BlasterGrappler>(); audioSource = GetComponent <AudioSource>(); // Primary hand SteamVR actions fireAction.AddOnStateDownListener(FireProjectile, parentHand.handType); fireAction.AddOnStateUpListener(PrimaryFireStateUp, parentHand.handType); //fireAction.AddOnUpdateListener(PrimaryFireStateUpdate, parentHand.otherHand.handType); // Off-hand SteamVR actions fireAction.AddOnStateDownListener(XR_SetNextPrimaryFireMode, parentHand.otherHand.handType); lastFireModeSwitch = Time.time; fireModes[0].OnFireModeSelected(); UpdateBlasterGlowMaterial(); }
public override void OnRelease(BlasterGrappler grappler) { //base.OnRelease(grappler); parentFSM.ragdollState.OnRelease(); }