Example #1
0
        // Token: 0x06003B5A RID: 15194 RVA: 0x0012AC5C File Offset: 0x0012905C
        private void GrabBegin()
        {
            float     num       = float.MaxValue;
            Grabbable grabbable = null;
            GrabPoint grabPoint = null;

            foreach (Grabbable grabbable2 in this.m_grabCandidates.Keys)
            {
                if (!grabbable2.IsGrabbed || grabbable2.AllowOffhandGrab)
                {
                    foreach (GrabPoint grabPoint2 in grabbable2.GrabPoints)
                    {
                        Vector3 b            = grabPoint2.GrabCollider.ClosestPointOnBounds(this.m_gripTransform.position);
                        float   sqrMagnitude = (this.m_gripTransform.position - b).sqrMagnitude;
                        if (sqrMagnitude < num)
                        {
                            num       = sqrMagnitude;
                            grabbable = grabbable2;
                            grabPoint = grabPoint2;
                        }
                    }
                }
            }
            this.GrabVolumeEnable(false);
            if (grabbable != null)
            {
                if (grabbable.IsGrabbed)
                {
                    grabbable.GrabbedHand.OffhandGrabbed(grabbable);
                }
                this.GrabbableGrab(grabbable, grabPoint);
            }
        }
Example #2
0
        // Token: 0x06003B3F RID: 15167 RVA: 0x0012A440 File Offset: 0x00128840
        public void GrabBegin(Hand hand, GrabPoint grabPoint)
        {
            this.m_grabbedHand      = hand;
            this.m_grabbedGrabPoint = grabPoint;
            if (this.m_grabbedGrabPoint.Rigidbody != null)
            {
                this.m_grabbedKinematic = this.m_grabbedGrabPoint.Rigidbody.isKinematic;
                this.m_grabbedGrabPoint.Rigidbody.isKinematic = true;
            }
            GrabbableGrabMsg grabbableGrabMsg = new GrabbableGrabMsg
            {
                Sender = this
            };

            this.SendMsg("OnGrabBegin", grabbableGrabMsg);
        }
Example #3
0
 // Token: 0x06003B5D RID: 15197 RVA: 0x0012AF1C File Offset: 0x0012931C
 private void GrabbableGrab(Grabbable grabbable, GrabPoint grabPoint)
 {
     this.m_grabbedGrabbable = grabbable;
     this.m_grabbedGrabbable.GrabBegin(this, grabPoint);
     this.m_grabbedHandPose = this.m_grabbedGrabbable.HandPose;
 }