public override void OnDetach(XRHand handAttachedMe) { if (handAttachedMe == hand2) { Destroy(joint2); joint2 = null; hand2 = null; if (hand.isHovering(this)) { attachedPositionLS = transform.InverseTransformPoint(hand.position); attachedRotationLS = Quaternion.Inverse(transform.rotation) * hand.rotation; } } else { if (hand2) { if (hand2AutoDrop) { hand2.DetachIfAny(); Destroy(joint); joint = null; hand = null; _OnDrop(); } else { Destroy(joint); joint = null; hand = null; hand = hand2; hand2 = null; joint = joint2; joint2 = null; jointBias = jointBias2; attachedPositionLS = attached2PositionLS; attachedRotationLS = attached2RotationLS; } } else { Destroy(joint); joint = null; hand = null; _OnDrop(); } } }