Пример #1
0
        public override void Disable()
        {
#if PLATFORM_LUMIN
            if (MLControllerCallbacksActive)
            {
                RemoveAllControllerDevices();
                MLInput.OnControllerConnected    -= MLControllerConnected;
                MLInput.OnControllerDisconnected -= MLControllerDisconnected;

                MLControllerCallbacksActive = false;
            }

            if (MLHandTrackingActive)
            {
                RemoveAllHandDevices();

                MLHandTrackingActive = true;
            }

            if (Instance == this)
            {
                Instance = null;
            }
#endif
        }
Пример #2
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="registrar">The <see cref="IMixedRealityServiceRegistrar"/> instance that loaded the data provider.</param>
        /// <param name="inputSystem">The <see cref="Microsoft.MixedReality.Toolkit.Input.IMixedRealityInputSystem"/> instance that receives data from this provider.</param>
        /// <param name="name">Friendly name of the service.</param>
        /// <param name="priority">Service priority. Used to determine order of instantiation.</param>
        /// <param name="profile">The service's configuration profile.</param>
        public MagicLeapDeviceManager(
            IMixedRealityInputSystem inputSystem,
            string name   = null,
            uint priority = DefaultPriority,
            BaseMixedRealityProfile profile = null) : base(inputSystem, name, priority, profile)
        {
#if PLATFORM_LUMIN && !UNITY_EDITOR
            if (!MLControllerCallbacksActive && MLInput.Start().IsOk)
            {
                MLInput.OnControllerConnected    += MLControllerConnected;
                MLInput.OnControllerDisconnected += MLControllerDisconnected;

                MLControllerCallbacksActive = true;
            }

            if (!MLHandTrackingActive && MLHandTracking.Start().IsOk)
            {
                MLHandTracking.KeyPoseManager.SetKeyPointsFilterLevel(MLHandTracking.KeyPointFilterLevel.Smoothed);
                MLHandTracking.KeyPoseManager.EnableKeyPoses(supportedGestures, true, false);

                MLHandTrackingActive = true;
            }
#endif

            if (Instance == null)
            {
                Instance = this;
            }
        }
Пример #3
0
 public override void Initialize()
 {
     if (Instance == null)
     {
         Instance = this;
     }
     base.Initialize();
 }