Exemplo n.º 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);
                }
            }
        }
Exemplo n.º 2
0
        public override void Interact(HandVR handVR)
        {
            base.Interact(handVR);

            if (handVR.GrabDown() && AttachedGrabbable)
            {
                AttachedGrabbable.Attach(handVR);
            }
        }
Exemplo n.º 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();
            }
        }