コード例 #1
0
        public static void GrabCheck(HandTarget handTarget, GameObject obj)
        {
            if (grabChecking || handTarget.grabbedObject != null || handTarget.humanoid.isRemote)
            {
                return;
            }

            grabChecking = true;
            float handCurl = handTarget.HandCurl();

            if (handCurl > 2 && CanBeGrabbed(handTarget, obj))
            {
                Grab(handTarget, obj);
            }
            grabChecking = false;
        }
コード例 #2
0
        public static void CheckLetGo(HandTarget handTarget)
        {
            if (handTarget.grabbedObject == null || handTarget.grabType == HandTarget.GrabType.Pinch)
            {
                return;
            }

            float handCurl        = handTarget.HandCurl();
            bool  fingersGrabbing = (handCurl >= 1.5F);
            bool  pulledLoose     = PulledLoose(handTarget);

            if (!fingersGrabbing || pulledLoose)
            {
                LetGo(handTarget);
            }
        }