Esempio n. 1
0
        private void InitPrimaryGrab(VRTK_InteractableObject currentGrabbedObject)
        {
            if (!currentGrabbedObject.IsValidInteractableController(gameObject, currentGrabbedObject.allowedGrabControllers))
            {
                grabbedObject = null;
                if (currentGrabbedObject.IsGrabbed(gameObject))
                {
                    interactTouch.ForceStopTouching();
                }
                return;
            }

            influencingGrabbedObject = false;
            currentGrabbedObject.SaveCurrentState();
            currentGrabbedObject.Grabbed(gameObject);
            currentGrabbedObject.ZeroVelocity();
            currentGrabbedObject.ToggleHighlight(false);
            currentGrabbedObject.ToggleKinematic(false);

            //Pause collisions (if allowed on object) for a moment whilst sorting out position to prevent clipping issues
            currentGrabbedObject.PauseCollisions();

            if (currentGrabbedObject.grabAttachMechanic == VRTK_InteractableObject.GrabAttachType.Child_Of_Controller)
            {
                currentGrabbedObject.ToggleKinematic(true);
            }
        }
Esempio n. 2
0
        protected virtual void InitSecondaryGrab(VRTK_InteractableObject currentGrabbedObject)
        {
            influencingGrabbedObject = true;
            currentGrabbedObject.Grabbed(this);

            if (ControllerSecondaryGrabInteractableObject != null)
            {
                ControllerSecondaryGrabInteractableObject(this, currentGrabbedObject.gameObject);
            }
        }
Esempio n. 3
0
        private void InitSecondaryGrab(VRTK_InteractableObject currentGrabbedObject)
        {
            if (!currentGrabbedObject.IsValidInteractableController(gameObject, currentGrabbedObject.allowedGrabControllers))
            {
                grabbedObject            = null;
                influencingGrabbedObject = false;
                currentGrabbedObject.Ungrabbed(gameObject);
                return;
            }

            influencingGrabbedObject = true;
            currentGrabbedObject.Grabbed(gameObject);
        }
        protected virtual void InitSecondaryGrab(VRTK_InteractableObject currentGrabbedObject)
        {
            GameObject grabbingObject = controllerReference.scriptAlias;

            if (!currentGrabbedObject.IsValidInteractableController(grabbingObject, currentGrabbedObject.allowedGrabControllers))
            {
                grabbedObject            = null;
                influencingGrabbedObject = false;
                currentGrabbedObject.Ungrabbed(grabbingObject);
                return;
            }

            influencingGrabbedObject = true;
            currentGrabbedObject.Grabbed(grabbingObject);
        }
Esempio n. 5
0
        protected virtual void InitSecondaryGrab(VRTK_InteractableObject currentGrabbedObject)
        {
            var grabbingObject = interactTouch.gameObject;

            if (!currentGrabbedObject.IsValidInteractableController(grabbingObject, currentGrabbedObject.allowedGrabControllers))
            {
                grabbedObject            = null;
                influencingGrabbedObject = false;
                currentGrabbedObject.Ungrabbed(grabbingObject);
                return;
            }

            influencingGrabbedObject = true;
            currentGrabbedObject.Grabbed(grabbingObject);
        }
Esempio n. 6
0
 // Token: 0x0600159F RID: 5535 RVA: 0x00076BD4 File Offset: 0x00074DD4
 protected virtual void InitSecondaryGrab(VRTK_InteractableObject currentGrabbedObject)
 {
     if (currentGrabbedObject.GetComponent <PhotonObjectInteract>().isGrabbed)
     {
         return;
     }
     if (!currentGrabbedObject.IsValidInteractableController(base.gameObject, currentGrabbedObject.allowedGrabControllers))
     {
         this.grabbedObject            = null;
         this.influencingGrabbedObject = false;
         currentGrabbedObject.Ungrabbed(this);
         return;
     }
     this.influencingGrabbedObject = true;
     currentGrabbedObject.Grabbed(this);
 }
        protected override void InitPrimaryGrab(VRTK_InteractableObject currentGrabbedObject)
        {
            if (!currentGrabbedObject.IsValidInteractableController(gameObject, currentGrabbedObject.allowedGrabControllers))
            {
                grabbedObject = null;
                if (interactTouch != null && currentGrabbedObject.IsGrabbed(gameObject))
                {
                    interactTouch.ForceStopTouching();
                }
                return;
            }

            influencingGrabbedObject = false;
            currentGrabbedObject.SaveCurrentState();
            currentGrabbedObject.Grabbed(this);
            currentGrabbedObject.ZeroVelocity();
            currentGrabbedObject.isKinematic = false;
        }
        protected virtual void InitPrimaryGrab(VRTK_InteractableObject currentGrabbedObject)
        {
            GameObject grabbingObject = controllerReference.scriptAlias;

            if (!currentGrabbedObject.IsValidInteractableController(grabbingObject, currentGrabbedObject.allowedGrabControllers))
            {
                grabbedObject = null;
                if (currentGrabbedObject.IsGrabbed(grabbingObject))
                {
                    interactTouch.ForceStopTouching();
                }
                return;
            }

            influencingGrabbedObject = false;
            currentGrabbedObject.SaveCurrentState();
            currentGrabbedObject.Grabbed(grabbingObject);
            currentGrabbedObject.ZeroVelocity();
            currentGrabbedObject.ToggleHighlight(false);
            currentGrabbedObject.isKinematic = false;
        }
Esempio n. 9
0
 // Token: 0x0600159E RID: 5534 RVA: 0x00076B4C File Offset: 0x00074D4C
 protected virtual void InitPrimaryGrab(VRTK_InteractableObject currentGrabbedObject)
 {
     if (currentGrabbedObject.GetComponent <PhotonObjectInteract>().isGrabbed)
     {
         return;
     }
     if (!currentGrabbedObject.IsValidInteractableController(base.gameObject, currentGrabbedObject.allowedGrabControllers))
     {
         this.grabbedObject = null;
         if (this.interactTouch != null && currentGrabbedObject.IsGrabbed(base.gameObject))
         {
             this.interactTouch.ForceStopTouching();
         }
         return;
     }
     this.influencingGrabbedObject = false;
     currentGrabbedObject.SaveCurrentState();
     currentGrabbedObject.Grabbed(this);
     currentGrabbedObject.ZeroVelocity();
     currentGrabbedObject.ToggleHighlight(false);
     currentGrabbedObject.isKinematic = false;
 }
 protected override void InitSecondaryGrab(VRTK_InteractableObject currentGrabbedObject)
 {
     influencingGrabbedObject = true;
     currentGrabbedObject.Grabbed(this);
 }