예제 #1
0
    private void InteractionManager_SourceDetected(UnityEngine.XR.WSA.Input.InteractionSourceDetectedEventArgs args)
    {
        // Check to see that the source is a hand.
        if (args.state.source.kind != UnityEngine.XR.WSA.Input.InteractionSourceKind.Hand)
        {
            return;
        }

        Vector3 pos;

        if (args.state.sourcePose.TryGetPosition(out pos) && allowTrack)
        {
            if (handednessOffsetObj != null)
            {
                bool isRightHand = Camera.main.worldToCameraMatrix.MultiplyPoint(pos).x > 0;
                handednessOffsetObj.transform.localPosition = isRightHand ? rightHandLocalPos : new Vector3(-rightHandLocalPos.x, rightHandLocalPos.y, rightHandLocalPos.z);
            }
            Vector3 temppos = new Vector3(pos.x, pos.y, pos.z + 0.05f);
            //   if (!TempMenu.activeSelf)
            //  {
            TrackingObject.SetActive(true);
            TrackingObject.transform.position = temppos;
            // }
            //  else
            //  {
            //       TempMenu.SetActive(true);
            //       TempMenu.transform.position = temppos;
            //   }
        }
    }
예제 #2
0
 private void InteractionManager_SourceDetected(UnityEngine.XR.WSA.Input.InteractionSourceDetectedEventArgs args)
 {
     handIsShown = true;
 }
예제 #3
0
 private void Source_Detected(UnityEngine.XR.WSA.Input.InteractionSourceDetectedEventArgs hand)
 {
     HandDetected = true;
 }