/// <summary>
        /// Used for getting the current tracker status.
        /// </summary>
        public static bool GetTrackerStatus()
        {
#if PLATFORM_LUMIN
            return(MLImageTracker.GetTrackerStatus());
#else
            return(false);
#endif
        }
 /// <summary>
 /// Handles the event for trigger down.
 /// </summary>
 /// <param name="controllerId">The id of the controller.</param>
 /// <param name="triggerValue">The value of the trigger.</param>
 private void HandleOnTriggerDown(byte controllerId, float triggerValue)
 {
     if (_hasStarted && MLImageTracker.IsStarted && _controllerConnectionHandler.IsControllerValid(controllerId))
     {
         if (MLImageTracker.GetTrackerStatus())
         {
             MLImageTracker.Disable();
             _trackerStatusLabel.text = "Tracker Status: Disabled";
         }
         else
         {
             MLImageTracker.Enable();
             _trackerStatusLabel.text = "Tracker Status: Enabled";
         }
     }
 }
示例#3
0
 /// <summary>
 /// Used for getting the current tracker status.
 /// </summary>
 public static bool GetTrackerStatus()
 {
     #if PLATFORM_LUMIN
     if (MLImageTracker.IsStarted)
     {
         return(MLImageTracker.GetTrackerStatus());
     }
     else
     {
         Debug.LogError("Error: MLImageTrackerStarterKit.GetTrackerStatus failed because MLImageTracker was not started.");
         return(false);
     }
     #else
     return(false);
     #endif
 }
示例#4
0
        /// <summary>
        /// Handles the event for trigger down.
        /// </summary>
        /// <param name="controllerId">The id of the controller.</param>
        /// <param name="triggerValue">The value of the trigger.</param>
        private void HandleOnTriggerDown(byte controllerId, float triggerValue)
        {
            if (_hasStarted && MLImageTracker.IsStarted && _controllerConnectionHandler.IsControllerValid(controllerId))
            {
                // The ImageTracker status before it is changed
                bool trackerStatus = MLImageTracker.GetTrackerStatus();

                // Try to change the ImageTracker status
                MLResult result = trackerStatus ? MLImageTracker.Disable() : MLImageTracker.Enable();

                if (!result.IsOk)
                {
                    Debug.LogErrorFormat("Error: Failed to {0} the ImageTracker.", trackerStatus ? "disable" : "enable");
                }

                else
                {
                    _trackerStatusLabel.text = "Tracker Status: " + (trackerStatus ? "Disabled" : "Enabled");
                }
            }
        }