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 }
/// <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; } }
public override void Initialize() { if (Instance == null) { Instance = this; } base.Initialize(); }