Пример #1
0
        /// <inheritdoc />
        protected override GenericXRSDKController GetOrAddController(InputDevice inputDevice)
        {
            GenericXRSDKController controller = base.GetOrAddController(inputDevice);

            if (controller is OculusXRSDKTouchController oculusTouchController)
            {
                oculusTouchController.UseMRTKControllerVisualization = cameraRig.IsNull();
            }

            return(controller);
        }
        /// <inheritdoc />
        protected override GenericXRSDKController GetOrAddController(InputDevice inputDevice)
        {
            GenericXRSDKController controller = base.GetOrAddController(inputDevice);

            if (!cameraRig.IsNull() && controller is OculusXRSDKTouchController oculusTouchController && oculusTouchController.OculusControllerVisualization == null)
            {
                GameObject platformVisualization = null;
                if (oculusTouchController.ControllerHandedness == Handedness.Left)
                {
                    platformVisualization = leftControllerHelper.gameObject;
                }
                if (oculusTouchController.ControllerHandedness == Handedness.Right)
                {
                    platformVisualization = rightControllerHelper.gameObject;
                }

                if (platformVisualization != null)
                {
                    oculusTouchController.RegisterControllerVisualization(platformVisualization);
                }
            }

            return(controller);
        }