예제 #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);
                }
            }
        }
예제 #2
0
파일: Slot.cs 프로젝트: helloMike/SimpleVR
        public override void Interact(HandVR handVR)
        {
            base.Interact(handVR);

            if (handVR.GrabDown() && AttachedGrabbable)
            {
                AttachedGrabbable.Attach(handVR);
            }
        }
예제 #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();
            }
        }