Example #1
0
        public override void Interact(HandVR handVR)
        {
            base.Interact(handVR);

            if (handVR.GrabDown())
            {
                initialMappingOffset = linearMapping.value - CalculateLinearMapping(handVR.transform);
                sampleCount          = 0;
                mappingChangeRate    = 0.0f;

                Interacting = true;
            }

            if (handVR.GrabUp())
            {
                CalculateMappingChangeRate();

                Interacting = false;
            }

            if (handVR.Grab())
            {
                if (Interacting)
                {
                    UpdateLinearMapping(handVR.transform);
                }
            }
        }
Example #2
0
        public override void Interact(HandVR handVR)
        {
            base.Interact(handVR);

            if (handVR.GrabDown() && AttachedGrabbable)
            {
                AttachedGrabbable.Attach(handVR);
            }
        }
Example #3
0
        public override void Interact(HandVR handVR)
        {
            base.Interact(handVR);

            if (handVR.GrabDown() && (!Attached || handVR != OwnerHandVR))
            {
                Attach(handVR);
            }
            else if (!handVR.Grab() && Attached && handVR == OwnerHandVR && !Overlapping)               //!handVR.Interact() instead of handVR.InteractUp() because it works if hand did the interactUp inside a wall and then it went out so it wasn't Blocked anymore
            {
                Detach();
            }
        }