コード例 #1
0
        public void SwitchHandTo(CurvedUIInputModule.Hand newHand)
        {
            CurvedUIInputModule.Instance.UsedHand = newHand;

            if (CurvedUIInputModule.Instance.ControllerTransform)
            {
                LaserBeam.transform.SetParent(CurvedUIInputModule.Instance.ControllerTransform);
                LaserBeam.transform.ResetTransform();
                LaserBeam.transform.LookAt(LaserBeam.transform.position + CurvedUIInputModule.Instance.ControllerPointingDirection);
            }
            else
            {
                Debug.LogError("CURVEDUI: No Active controller that can be used as a parent of the pointer. Is the controller gameobject present on the scene and active?");
            }
        }
コード例 #2
0
 void SwitchHandTo(CurvedUIInputModule.Hand newHand)
 {
     if (newHand == CurvedUIInputModule.Hand.Right)
     {
         CurvedUIInputModule.Instance.UsedHand = CurvedUIInputModule.Hand.Right;
         LaserPointer.transform.SetParent(CurvedUIInputModule.Right.transform);
         LaserPointer.transform.ResetTransform();
         LaserPointer.transform.position = CurvedUIInputModule.Right.PointingOrigin;
         LaserPointer.transform.LookAt(LaserPointer.transform.position + CurvedUIInputModule.Right.PointingDirection);
     }
     else
     {
         CurvedUIInputModule.Instance.UsedHand = CurvedUIInputModule.Hand.Left;
         LaserPointer.transform.SetParent(CurvedUIInputModule.Left.transform);
         LaserPointer.transform.ResetTransform();
         LaserPointer.transform.position = CurvedUIInputModule.Left.PointingOrigin;
         LaserPointer.transform.LookAt(LaserPointer.transform.position + CurvedUIInputModule.Left.PointingDirection);
     }
 }
コード例 #3
0
 void SwitchHandTo(CurvedUIInputModule.Hand newHand)
 {
     CurvedUIInputModule.Instance.UsedHand = newHand;
     LaserPointer.transform.SetParent(CurvedUIInputModule.Instance.OculusTouchUsedControllerTransform);
     LaserPointer.transform.ResetTransform();
 }