Exemple #1
0
        /// <summary>
        /// Updates Status Label with latest data.
        /// </summary>
        private void UpdateStatusText()
        {
            _overviewStatusText.text = string.Format("<color=#dbfb76><b>{0} {1}</b></color>\n{2}: {3}\n\n",
                                                     LocalizeManager.GetString("Controller"),
                                                     LocalizeManager.GetString("Data"),
                                                     LocalizeManager.GetString("Status"),
                                                     LocalizeManager.GetString(ControllerStatus.Text));

            _overviewStatusText.text += string.Format("<color=#dbfb76><b>{0} {1}</b></color>\n{2}: {3} \n{4}: {5}\n\n",
                                                      LocalizeManager.GetString("Raycast"),
                                                      LocalizeManager.GetString("Data"),
                                                      LocalizeManager.GetString("Mode"),
                                                      LocalizeManager.GetString(_raycastMode.ToString()),
                                                      LocalizeManager.GetString("Confidence"),
                                                      LocalizeManager.GetString(_confidence.ToString()));

            if (_raycastMode == RaycastMode.Eyes)
            {
                _overviewStatusText.text += string.Format("<color=#dbfb76><b>{0} {1}</b></color>\n{2} {3}:{4}\n\n",
                                                          LocalizeManager.GetString("Eye"),
                                                          LocalizeManager.GetString("Data"),
                                                          LocalizeManager.GetString("Calibration"),
                                                          LocalizeManager.GetString("Status"),
                                                          LocalizeManager.GetString(MLEyesStarterKit.CalibrationStatus));
            }
        }
        /// <summary>
        /// Update the UI status text with the latest data.
        /// </summary>
        void Update()
        {
            statusText.text = string.Format("<color=#dbfb76><b>{0}</b></color>\n{1}: {2}\n",
                                            LocalizeManager.GetString("ControllerData"),
                                            LocalizeManager.GetString("Status"),
                                            LocalizeManager.GetString(ControllerStatus.Text));

            #if PLATFORM_LUMIN
            MLMusicService.Metadata metaData = musicService.CurrentTrackMetadata;
            statusText.text += string.Format("\n<color=#dbfb76><b>{0}</b></color>\n{1}: {2}\n{3}: {4}\n{5}: {6}\n{7}: {8}\n{9}: {10}\n{11}: {12}\n{13}: {14}\n",
                                             LocalizeManager.GetString("MusicServiceData"),
                                             LocalizeManager.GetString("Status"),
                                             LocalizeManager.GetString("Ok"),
                                             LocalizeManager.GetString("TrackTitle"),
                                             metaData.TrackTitle,
                                             LocalizeManager.GetString("AlbumName"),
                                             metaData.AlbumInfoName,
                                             LocalizeManager.GetString("AlbumURL"),
                                             metaData.AlbumInfoUrl,
                                             LocalizeManager.GetString("AlbumCoverURL"),
                                             metaData.AlbumInfoCoverUrl,
                                             LocalizeManager.GetString("ArtistName"),
                                             metaData.ArtistInfoName,
                                             LocalizeManager.GetString("ArtistURL"),
                                             metaData.ArtistInfoUrl);
            #endif
        }
Exemple #3
0
        /// <summary>
        /// Updates examples status text.
        /// </summary>
        private void UpdateStatusText()
        {
            _statusLabel.text = string.Format("<color=#dbfb76><b>{0} {1}</b></color>\n{2}: {3}\n",
                                              LocalizeManager.GetString("Controller"),
                                              LocalizeManager.GetString("Data"),
                                              LocalizeManager.GetString("Status"),
                                              LocalizeManager.GetString(ControllerStatus.Text));

            _statusLabel.text += string.Format(
                "\n<color=#dbfb76><b>{0} {1}</b></color>\n{2} {3}: {4}\n{5} {6}: {7}\n{8}: {9}",
                LocalizeManager.GetString("Meshing"),
                LocalizeManager.GetString("Data"),
                LocalizeManager.GetString("Render"),
                LocalizeManager.GetString("Mode"),
                LocalizeManager.GetString(_renderMode.ToString()),
                LocalizeManager.GetString("Bounded"),
                LocalizeManager.GetString("Extents"),
                LocalizeManager.GetString(_bounded.ToString()),
                LocalizeManager.GetString("LOD"),
                #if UNITY_2019_3_OR_NEWER
                LocalizeManager.GetString(MLSpatialMapper.DensityToLevelOfDetail(_mlSpatialMapper.density).ToString())
                #else
                LocalizeManager.GetString(_mlSpatialMapper.levelOfDetail.ToString())
                #endif
                );
        }
Exemple #4
0
 /// <summary>
 /// Updates examples status text.
 /// </summary>
 private void UpdateStatusText()
 {
     _statusText.text = string.Format("<color=#dbfb76><b>{0}</b></color>\n{1}: {2}\n",
                                      LocalizeManager.GetString("ControllerData"),
                                      LocalizeManager.GetString("Status"),
                                      LocalizeManager.GetString(ControllerStatus.Text));
 }
Exemple #5
0
        /// <summary>
        /// Sets the status text of the UI.
        /// </summary>
        void Update()
        {
            _statusText.text = string.Format("<color=#dbfb76><b>{0}</b></color>\n{1}: {2}\n\n",
                                             LocalizeManager.GetString("ControllerData"),
                                             LocalizeManager.GetString("Status"),
                                             LocalizeManager.GetString(_controllerConnectionHandler.IsControllerValid() ? "Controller Connected" : "Disconnected"));

            _statusText.text += string.Format("<color=#dbfb76><b>{0}</b></color>\n{1}: {2}\n\n",
                                              LocalizeManager.GetString("MLAControllerData"),
                                              LocalizeManager.GetString("Status"),
                                              LocalizeManager.GetString(ControllerStatus.Text));

            #if PLATFORM_LUMIN
            MLNetworking.IsInternetConnected(ref _internetConnected);
            #endif

            _statusText.text += string.Format("<color=#dbfb76><b>{0}</b></color>\n{1}: {2}\n\n",
                                              LocalizeManager.GetString("InternetData"),
                                              LocalizeManager.GetString("Status"),
                                              LocalizeManager.GetString(_internetConnected ? "Connected" : "Disconnected"));


            if (_lastLogMessage != "")
            {
                _statusText.text += string.Format("<color=#dbfb76><b>{0}</b></color>\n{1}: {2}\n\n",
                                                  LocalizeManager.GetString("ContactsData"),
                                                  LocalizeManager.GetString("LastAction"),
                                                  LocalizeManager.GetString(_lastLogMessage));
            }
        }
        private void UpdateStatusText()
        {
            _statusText.text = string.Format("<color=#dbfb76><b>{0} </b></color>\n{1}: {2}\n",
                                             LocalizeManager.GetString("ControllerData"),
                                             LocalizeManager.GetString("Status"),
                                             LocalizeManager.GetString(ControllerStatus.Text));

            _statusText.text += string.Format("\n<color=#dbfb76><b>{0} </b></color>\n {1}: <color=green>{2}</color>", LocalizeManager.GetString("HandMeshData"), LocalizeManager.GetString("CurrentRenderMode"), LocalizeManager.GetString(_mode.ToString()));
        }
Exemple #7
0
 /// <summary>
 /// Handle if a new session occurs
 /// </summary>
 /// <param name="mapEvents"> Map Events that happened. </param>
 private void OnHeadTrackingMapEvent(MLHeadTracking.MapEvents mapEvents)
 {
     #if PLATFORM_LUMIN
     if (mapEvents.IsNewSession())
     {
         _statusText.text = LocalizeManager.GetString("New map session");
     }
     #endif
 }
Exemple #8
0
        private void UpdateStatus()
        {
            _statusText.text = string.Format("<color=#dbfb76><b>{0} </b></color>\n{1}: {2}\n",
                                             LocalizeManager.GetString("ControllerData"),
                                             LocalizeManager.GetString("Status"),
                                             LocalizeManager.GetString(ControllerStatus.Text)) + locationErrorText;

            _statusText.text += string.Format("\n<color=#dbfb76><b>{0} </b></color>:\n",
                                              LocalizeManager.GetString("LocationData")) + _fineLocationText.text;
        }
Exemple #9
0
        /// <summary>
        /// Updates examples status text.
        /// </summary>
        private void UpdateStatusText()
        {
            _statusText.text = string.Format("<color=#dbfb76><b>{0}</b></color>\n{1}: {2}\n",
                                             LocalizeManager.GetString("ControllerData"),
                                             LocalizeManager.GetString("Status"),
                                             LocalizeManager.GetString(ControllerStatus.Text));

            _statusText.text += string.Format("\n<color=#dbfb76><b>{0}</b></color>\n{1}\n",
                                              LocalizeManager.GetString("ActiveMediaPlayer"),
                                              _mediaPlayerExamplePrefabs[_mediaPlayerExamplePrefabIndex].name);
        }
Exemple #10
0
        private void UpdateSwitchTooltip()
        {
            #if PLATFORM_LUMIN
            _switchTooltip.transform.position = MLHandTrackingStarterKit.Right.Thumb.KeyPoints[0].Position;
            #endif

            _switchTooltip.text = string.Format("{0}<color=yellow>{1}</color> {2} {3} seconds",
                                                LocalizeManager.GetString("Switchingto"),
                                                GetNextRenderMode(),
                                                LocalizeManager.GetString("In"),
                                                _timer.ToString("0.0"));
        }
Exemple #11
0
        /// <summary>
        /// Updates the UI text.
        /// </summary>
        void Update()
        {
            _statusText.text = string.Format("<color=#dbfb76><b>{0}</b></color>\n{1}: {2}\n\n",
                                             LocalizeManager.GetString("Tablet Data"),
                                             LocalizeManager.GetString("Status"),
                                             LocalizeManager.GetString(_wacomTabletVisualizer.Connected ? "Connected" : "Disconnected"));

            if (_wacomTabletVisualizer.Connected)
            {
                _statusText.text += string.Format(
                    "<b><color=#dbfb76>{0}</color></b>\n" +
                    "\t{1}:\t\t({2}, {3})\n" +
                    "\t{4}:\t\t{5}\n" +
                    "\t{6}:\t\t{7}\n" +
                    "\t{8}:\t\t\t\t\t({9}, {10})\n" +
                    "\t{11}:\t\t{12}\n" +
                    "\t{13}:\t{14}\n" +
                    "\n" +
                    "<b><color=#dbfb76>{15}</color></b>\n" +
                    "\t{16}: {17}\n" +
                    "\t{18}:\t\t\t{19} - {20}",
                    LocalizeManager.GetString("Pen"),
                    LocalizeManager.GetString("Location"),
                    _wacomTabletVisualizer.LastPositionAndForce.x,
                    _wacomTabletVisualizer.LastPositionAndForce.y,
                    LocalizeManager.GetString("Pressure"),
                    _wacomTabletVisualizer.LastPositionAndForce.z,
                    LocalizeManager.GetString("Distance"),
                    _wacomTabletVisualizer.LastDistance,
                    LocalizeManager.GetString("Tilt"),
                    _wacomTabletVisualizer.LastTilt.x,
                    _wacomTabletVisualizer.LastTilt.y,
                    LocalizeManager.GetString("Touching"),
                    _wacomTabletVisualizer.LastIsTouching,
                    LocalizeManager.GetString("Tool Type"),
                #if PLATFORM_LUMIN
                    (_wacomTabletVisualizer.ButtonErase) ? "Button - Eraser" : _wacomTabletVisualizer.LastToolType.ToString(),
                #else
                    string.Empty,
                #endif
                    LocalizeManager.GetString("Events"),
                    LocalizeManager.GetString("Touch Ring"),
                    _wacomTabletVisualizer.LastTouchRing,
                    LocalizeManager.GetString("Button"),
                #if PLATFORM_LUMIN
                    _wacomTabletVisualizer.LastButton,
                #else
                    string.Empty,
                #endif
                    _wacomTabletVisualizer.LastButtonState);
            }
        }
Exemple #12
0
        private void Awake()
        {
            // Canvas Initialization
            _placeFromCamera = GetComponent <PlaceFromCamera>();

            _canvasDistance           = _minDistance;
            _placeFromCamera.Distance = _canvasDistance;

            if (_useLocalization)
            {
                // Title
                _title.text = LocalizeManager.GetString(_title.text);

                // Tabs
                Text overviewTabText = _overviewTab.GetComponentInChildren <Text>(true);
                if (overviewTabText != null)
                {
                    overviewTabText.text = LocalizeManager.GetString(overviewTabText.text);
                }

                Text controlsTabText = _controlsTab.GetComponentInChildren <Text>(true);
                if (controlsTabText != null)
                {
                    controlsTabText.text = LocalizeManager.GetString(controlsTabText.text);
                }

                Text _issueTabText = _issuesTab.GetComponentInChildren <Text>(true);
                if (_issueTabText != null)
                {
                    _issueTabText.text = LocalizeManager.GetString(_issueTabText.text);
                }

                Text _statusTabText = _statusTab.GetComponentInChildren <Text>(true);
                if (_statusTabText != null)
                {
                    _statusTabText.text = LocalizeManager.GetString(_statusTabText.text);
                }

                // Descriptions - Load From File
                _overviewText.text = LocalizeManager.GetString(_overviewText.text);
                _controlsText.text = LocalizeManager.GetString(_controlsText.text);
                _statusText.text   = LocalizeManager.GetString(_statusText.text);
            }

            Application.logMessageReceived += HandleOnLogMessageReceived;

            // Open the these two tabs by default.
            _overviewTab.Pressed();
            _statusTab.Pressed();
        }
Exemple #13
0
        /// <summary>
        /// Updates the status text.
        /// </summary>
        private void UpdateStatus()
        {
            _statusText.text = string.Format("<color=#dbfb76><b>{0} {1}</b></color>\n{2}: {3}\n",
                                             LocalizeManager.GetString("Controller"),
                                             LocalizeManager.GetString("Data"),
                                             LocalizeManager.GetString("Status"),
                                             LocalizeManager.GetString(ControllerStatus.Text));

            _statusText.text += string.Format(
                "\n<color=#dbfb76><b> {0} {1}</b></color>\n {0} {2}: {3}",
                LocalizeManager.GetString("Light"),
                LocalizeManager.GetString("Data"),
                LocalizeManager.GetString("Intensity"),
                MLLightingTrackingStarterKit.NormalizedLuminance);
        }
        /// <summary>
        /// Updates the _statusText used by the UI.
        /// </summary>
        void Update()
        {
            _statusText.text = string.Format("<color=#dbfb76><b>{0}</b></color>\n{1}: {2}\n\n",
                                             LocalizeManager.GetString("ControllerData"),
                                             LocalizeManager.GetString("Status"),
                                             LocalizeManager.GetString(ControllerStatus.Text));

            foreach (MLImageTrackerBehavior imageTracker in _imageTrackers)
            {
                _statusText.text += string.Format("<color=#dbfb76><b>{0}</b></color>\n{1}: {2}\n\n",
                                                  LocalizeManager.GetString(imageTracker.name),
                                                  LocalizeManager.GetString("Status"),
                                                  LocalizeManager.GetString(imageTracker.TrackingStatus.ToString())
                                                  );
            }
        }
Exemple #15
0
        /// <summary>
        /// Polls current location data.
        /// </summary>
        private void GetLocation(bool useFineLocation = false)
        {
            #if PLATFORM_LUMIN
            MLResult result = MLLocationStarterKit.GetLocation(out MLLocation.Location newLocation, useFineLocation);

            if (result.IsOk)
            {
                string formattedString =
                    "{0}:\t<i>{1}</i>\n" +
                    "{2}:\t<i>{3}</i>\n" +
                    "{4}:\t<i>{5}</i>\n" +
                    "{6}:\t<i>{7}</i>\n" +
                    (useFineLocation ? "{8}:\t<i>{9}</i>" : "");

                Text locationText = useFineLocation ? _fineLocationText : _coarseLocationText;

                locationText.text = String.Format(formattedString,
                                                  LocalizeManager.GetString("Latitude"), newLocation.Latitude,
                                                  LocalizeManager.GetString("Longitude"), newLocation.Longitude,
                                                  LocalizeManager.GetString("PostalCode"), newLocation.HasPostalCode ? newLocation.PostalCode : "(unknown)",
                                                  LocalizeManager.GetString("Timestamp"), newLocation.Timestamp,
                                                  LocalizeManager.GetString("Accuracy"), newLocation.Accuracy
                                                  );

                if (!_placedGlobe && !_placedPin)
                {
                    StartCoroutine(PlaceGlobe());
                    PlacePin(MLLocationStarterKit.GetWorldCartesianCoords(newLocation.Latitude, newLocation.Longitude, _globe.GetComponent <SphereCollider>().radius));
                }
            }
            else
            {
                if (result.Result == MLResult.Code.LocationNetworkConnection)
                {
                    locationErrorText = "<color=red>Received network error, please check the network connection and relaunch the application.</color>";
                }
                else
                {
                    locationErrorText = "<color=red>Failed to retrieve location with result: " + result.Result + "</color>";
                }

                MLLocationStarterKit.Stop();
                enabled = false;
                return;
            }
            #endif
        }
Exemple #16
0
        /// <summary>
        /// Convert camera calibration parameters to a string.
        /// </summary>
        /// <param name="parameters">The camera calibration values to pull from.</param>
        static string CalibrationParametersToString(MLCamera.IntrinsicCalibrationParameters parameters)
        {
            StringBuilder b = new StringBuilder();

            b.AppendFormat("\n <color=#dbfb76><b>{0}  {1}:</b></color>", LocalizeManager.GetString("Camera"), LocalizeManager.GetString("IntrinsicValues"))
            .AppendFormat("\n   {0}: {1}", LocalizeManager.GetString("Width"), parameters.Width)
            .AppendFormat("\n   {0}: {1}", LocalizeManager.GetString("Height"), parameters.Height)
            .AppendFormat("\n   {0}: {1}", LocalizeManager.GetString("FocalLength"), parameters.FocalLength)
            .AppendFormat("\n   {0}: {1}", LocalizeManager.GetString("PrincipalPoint"), parameters.PrincipalPoint)
            .AppendFormat("\n   {0}: {1}", LocalizeManager.GetString("FOV"), parameters.FOV)
            .AppendFormat("\n   {0}:", LocalizeManager.GetString("DistortionCoeff"));
            for (int i = 0; i < parameters.Distortion.Length; ++i)
            {
                b.AppendFormat("\n   [{0}]: {1}", i, parameters.Distortion[i]);
            }
            return(b.ToString());
        }
Exemple #17
0
        /// <summary>
        /// Update the example status label.
        /// </summary>
        private void UpdateStatus()
        {
            _statusLabel.text = string.Format("<color=#dbfb76><b>{0} {1}</b></color>\n{2}: {3}\n",
                                              LocalizeManager.GetString("Controller"),
                                              LocalizeManager.GetString("Data"),
                                              LocalizeManager.GetString("Status"),
                                              LocalizeManager.GetString(ControllerStatus.Text));

            _statusLabel.text += string.Format("\n<color=#dbfb76><b>{0} {1}</b></color>\n", LocalizeManager.GetString("AudioCapture"), LocalizeManager.GetString("Data"));
            if (!_canCapture)
            {
                _statusLabel.text += (_privilegeRequester.State != MLPrivilegeRequesterBehavior.PrivilegeState.Failed) ? string.Format("{0}: {1}", LocalizeManager.GetString("Status"), LocalizeManager.GetString("Requesting Privileges")) : string.Format("{0}: {1}", LocalizeManager.GetString("Status"), LocalizeManager.GetString("Privileges Denied"));
            }
            else
            {
                _statusLabel.text += string.Format("{0}: {1}", LocalizeManager.GetString("Status"), LocalizeManager.GetString(_captureMode.ToString()));
            }
        }
        /// <summary>
        /// Handles an error from the MLMusicService.
        /// </summary>
        /// <param name="error">The error that ocurred.</param>
        private void HandleError(MLMusicService.Error error)
        {
            statusText.text = string.Format("<color=#dbfb76><b>{0}</b></color>\n{1}: {2}\n",
                                            LocalizeManager.GetString("ControllerData"),
                                            LocalizeManager.GetString("Status"),
                                            LocalizeManager.GetString(ControllerStatus.Text));

            MLMusicService.Metadata metaData = musicService.CurrentTrackMetadata;
            statusText.text += string.Format("<color=#dbfb76><b>{0}</b></color>\n{1}: {2} - {3}: {4}, {5}: {6}",
                                             LocalizeManager.GetString("MusicServiceData"),
                                             LocalizeManager.GetString("Status"),
                                             LocalizeManager.GetString("Error"),
                                             LocalizeManager.GetString("Type"),
                                             error.Type,
                                             LocalizeManager.GetString("Code"),
                                             error.Code);

            enabled = false;
            return;
        }
Exemple #19
0
        void Update()
        {
            _statusText.text = string.Format("<color=#dbfb76><b>{0}</b></color>\n{1}: {2}\n",
                                             LocalizeManager.GetString("Controller Data"),
                                             LocalizeManager.GetString("Status"),
                                             LocalizeManager.GetString(ControllerStatus.Text));

            MLInput.Controller controller = _controllerConnectionHandler.ConnectedController;
            if (controller != null)
            {
                #if PLATFORM_LUMIN
                _statusText.text += string.Format("" +
                                                  "Position: <i>{0}</i>\n" +
                                                  "Rotation: <i>{1}</i>\n\n" +
                                                  "<color=#dbfb76><b>Buttons</b></color>\n" +
                                                  "Trigger: <i>{2}</i>\n" +
                                                  "Bumper: <i>{3}</i>\n\n" +
                                                  "<color=#dbfb76><b>Touchpad</b></color>\n" +
                                                  "Touch 1 Location: <i>({4},{5})</i>\n" +
                                                  "Touch 2 Location: <i>({6},{7})</i>\n\n" +
                                                  "<color=#dbfb76><b>Gestures</b></color>\n" +
                                                  "<i>{8} {9}</i>\n\n",

                                                  "No information available",
                                                  controller.Orientation.eulerAngles.ToString("n2"),
                                                  controller.TriggerValue.ToString("n2"),
                                                  controller.IsBumperDown,
                                                  controller.Touch1Active ? controller.Touch1PosAndForce.x.ToString("n2") : "0.00",
                                                  controller.Touch1Active ? controller.Touch1PosAndForce.y.ToString("n2") : "0.00",
                                                  controller.Touch2Active ? controller.Touch2PosAndForce.x.ToString("n2") : "0.00",
                                                  controller.Touch2Active ? controller.Touch2PosAndForce.y.ToString("n2") : "0.00",
                                                  controller.CurrentTouchpadGesture.Type.ToString(),
                                                  controller.TouchpadGestureState.ToString());
                #endif

                _statusText.text += string.Format("<color=#dbfb76><b>{0}</b></color>\n{1}: {2}",
                                                  LocalizeManager.GetString("Keyboard"),
                                                  LocalizeManager.GetString("Input"),
                                                  LocalizeManager.GetString(_mobileAppVisualizer.KeyboardText));
            }
        }
Exemple #20
0
        /// <summary>
        /// Update status data with new information.
        /// </summary>
        void Update()
        {
            _statusText.text = string.Format("<color=#dbfb76><b>{0} {1}</b></color>\n{2}: {3}\n\n",
                                             LocalizeManager.GetString("Controller"),
                                             LocalizeManager.GetString("Data"),
                                             LocalizeManager.GetString("Status"),
                                             LocalizeManager.GetString(ControllerStatus.Text));

            _statusText.text += string.Format(
                "<color=#dbfb76><b>{0} {1} {2}</b></color>\n{3}: {4}\n{5}:{6}\n{7}:{8} {9}",
                LocalizeManager.GetString("World"),
                LocalizeManager.GetString("Scale"),
                LocalizeManager.GetString("Data"),
                LocalizeManager.GetString("Measurement"),
                _worldScale.Measurement.ToString(),
                LocalizeManager.GetString("Scale"),
                _worldScale.Scale,
                LocalizeManager.GetString("Distance"),
                _positionMarker.localPosition.z * _worldScale.Scale,
                _worldScale.Units);
        }
        /// <summary>
        ///  Polls the Gestures API for up to date confidence values.
        /// </summary>
        void Update()
        {
            _statusText.text = string.Format("<color=#dbfb76><b>{0}</b></color>\n{1}: {2}\n\n",
                                             LocalizeManager.GetString("ControllerData"),
                                             LocalizeManager.GetString("Status"),
                                             LocalizeManager.GetString(ControllerStatus.Text));

            #if PLATFORM_LUMIN
            _statusText.text += string.Format(
                "<color=#dbfb76><b>{0}</b></color>\n<color=#dbfb76>{1}</color>: {2}\n{3}% {4}\n\n<color=#dbfb76>{5}</color>: {6}\n{7}% {8}",
                LocalizeManager.GetString("HandsData"),
                LocalizeManager.GetString("Left"),
                MLHandTrackingStarterKit.Left.KeyPose.ToString(),
                (MLHandTrackingStarterKit.Left.HandKeyPoseConfidence * 100.0f).ToString("n0"),
                LocalizeManager.GetString("Confidence"),
                LocalizeManager.GetString("Right"),
                MLHandTrackingStarterKit.Right.KeyPose.ToString(),
                (MLHandTrackingStarterKit.Right.HandKeyPoseConfidence * 100.0f).ToString("n0"),
                LocalizeManager.GetString("Confidence"));
            #endif
        }
        /// <summary>
        /// Updates the status text inside the UI.
        /// </summary>
        void Update()
        {
            string exampleStatus = "";

            if (_deleteAllInitiated)
            {
                if (_deleteAllSequenceFrameCount < _deleteAllSequenceMinFrames)
                {
                    exampleStatus = string.Format("<color=yellow>{0} {1:P} {2}.</color>",
                                                  LocalizeManager.GetString("DeleteAllSequence"),
                                                  LocalizeManager.GetString("Complete"),
                                                  (float)(_deleteAllSequenceFrameCount) / _deleteAllSequenceMinFrames);
                }
            }

            _statusText.text = string.Format("<color=#dbfb76><b>{0}</b></color>\n{1}: {2}\n\n",
                                             LocalizeManager.GetString("ControllerData"),
                                             LocalizeManager.GetString("Status"),
                                             LocalizeManager.GetString(ControllerStatus.Text));

            #if PLATFORM_LUMIN
            _statusText.text += string.Format("<color=#dbfb76><b>{0}</b></color>\n{1}: {2}\n{3}\n",
                                              LocalizeManager.GetString("ExampleData"),
                                              LocalizeManager.GetString("Status"),
                                              LocalizeManager.GetString(MLPersistentCoordinateFrames.IsLocalized ? "LocalizedToMap" : "NotLocalizedToMap"),
                                              LocalizeManager.GetString(exampleStatus));
            #endif

            _statusText.text += string.Format("{0}: {1}\n", LocalizeManager.GetString("RegainedContent"), numPersistentContentRegained);

            _statusText.text += string.Format("{0}: {1}\n\n", LocalizeManager.GetString("CreatedContent"), numPersistentContentCreated);

            if (PCFVisualizer.IsVisualizing)
            {
                _statusText.text += string.Format("{0}: {1}\n", LocalizeManager.GetString("Total PCFCount"), numTotalPCFs);
                _statusText.text += string.Format("{0}: {1}\n", LocalizeManager.GetString("Singer-Single PCFCount"), numSingerUserSingleSessionPCFs);
                _statusText.text += string.Format("{0}: {1}\n", LocalizeManager.GetString("Single-Multi PCFCount"), numSingleUserMultiSessionPCFs);
                _statusText.text += string.Format("{0}: {1}\n", LocalizeManager.GetString("Multi-Multi PCFCount"), numMultiUserMultiSessionPCFs);
            }
        }
Exemple #23
0
        /// <summary>
        /// Updates examples status text.
        /// </summary>
        private void UpdateStatusText()
        {
            _statusLabel.text = string.Format("<color=#dbfb76><b>{0} {1}</b></color>\n{2}: {3}\n",
                                              LocalizeManager.GetString("Controller"),
                                              LocalizeManager.GetString("Data"),
                                              LocalizeManager.GetString("Status"),
                                              LocalizeManager.GetString(ControllerStatus.Text));

            _statusLabel.text += string.Format(
                "\n<color=#dbfb76><b>{0} {1}</b></color>\n{2} {3}: {4}\n{5} {6}: {7}\n{8}: {9}",
                LocalizeManager.GetString("Meshing"),
                LocalizeManager.GetString("Data"),
                LocalizeManager.GetString("Render"),
                LocalizeManager.GetString("Mode"),
                LocalizeManager.GetString(_meshingVisualizer.RenderMode.ToString()),
                LocalizeManager.GetString("Bounded"),
                LocalizeManager.GetString("Extents"),
                LocalizeManager.GetString(_bounded.ToString()),
                LocalizeManager.GetString("LOD"),
                LocalizeManager.GetString(_meshingBehavior.LevelOfDetail.ToString())
                );
        }
Exemple #24
0
        /// <summary>
        /// Update plane query bounds extents based on if the current _bounded status is true(bounded)
        /// or false(boundless).
        /// </summary>
        private void UpdateBounds()
        {
            _planes.transform.localScale = _bounded ? _boundedExtentsSize : _boundlessExtentsSize;
            _boundsWireframeCube.SetActive(_bounded);

            _statusText.text = string.Format("<color=#dbfb76><b>{0}</b></color>\n{1}: {2}\n\n",
                                             LocalizeManager.GetString("Controller Data"),
                                             LocalizeManager.GetString("Status"),
                                             LocalizeManager.GetString(ControllerStatus.Text));

            _renderModeTextString = string.Format("<color=#dbfb76><b>{0}</b></color>\n{1}\n\n",
                                                  LocalizeManager.GetString("Render Mode"),
                                                  LocalizeManager.GetString(_planesVisualizer.RenderMode.ToString()));

            _boundsExtentsTextString = string.Format("<color=#dbfb76><b>{0}</b></color>\n ({1},{2},{3})\n\n",
                                                     LocalizeManager.GetString("Bounds Extents"),
                                                     _planes.transform.localScale.x,
                                                     _planes.transform.localScale.y,
                                                     _planes.transform.localScale.z);

            _statusText.text += _renderModeTextString + _boundsExtentsTextString + _numPlanesTextString + _numBoundariesTextString;
        }
Exemple #25
0
        /// <summary>
        /// Callback handler, changes text when new planes are received.
        /// </summary>
        /// <param name="planes"> Array of new planes. </param>
        /// <param name="boundaries"> Array of new boundaries. </param>
        private void OnQueriedPlanes(MLPlanes.Plane[] planes, MLPlanes.Boundaries[] boundaries)
        {
            _statusText.text = string.Format("<color=#dbfb76><b>{0}</b></color>\n{1}: {2}\n\n",
                                             LocalizeManager.GetString("Controller Data"),
                                             LocalizeManager.GetString("Status"),
                                             LocalizeManager.GetString(ControllerStatus.Text));

            _renderModeTextString = string.Format("<color=#dbfb76><b>{0}</b></color>\n{1}\n\n",
                                                  LocalizeManager.GetString("Render Mode"),
                                                  LocalizeManager.GetString(_planesVisualizer.RenderMode.ToString()));

            _boundsExtentsTextString = string.Format("<color=#dbfb76><b>{0}</b></color>\n ({1},{2},{3})\n\n",
                                                     LocalizeManager.GetString("Bounds Extents"),
                                                     _planes.transform.localScale.x,
                                                     _planes.transform.localScale.y,
                                                     _planes.transform.localScale.z);

            _numPlanesTextString     = string.Format("<color=#dbfb76><b>{0}</b></color>\n {1} / {2}\n\n", LocalizeManager.GetString("Planes"), planes.Length, _planes.MaxPlaneCount);
            _numBoundariesTextString = string.Format("<color=#dbfb76><b>{0}</b></color>\n {1} / {2}\n\n", LocalizeManager.GetString("Boundaries"), boundaries.Length, _planes.MaxPlaneCount);

            _statusText.text += _renderModeTextString + _boundsExtentsTextString + _numPlanesTextString + _numBoundariesTextString;
        }
Exemple #26
0
        /// <summary>
        /// Update Status Tabin Ui.
        /// </summary>
        private void UpdateStatusText()
        {
            _statusText.text = string.Format("<color=#dbfb76><b>{0} </b></color>\n{1}: {2}\n",
                                             LocalizeManager.GetString("ControllerData"),
                                             LocalizeManager.GetString("Status"),
                                             LocalizeManager.GetString(ControllerStatus.Text));

            _statusText.text += string.Format("\n<color=#dbfb76><b>{0}</b></color>:\n", LocalizeManager.GetString("VideoData"));

            if (_rawVideoCaptureMode)
            {
                _statusText.text += string.Format("{0}: {1}\n",
                                                  LocalizeManager.GetString("Mode"),
                                                  LocalizeManager.GetString("RawVideoCapture"));

                _statusText.text += _intrinsicValuesText;
            }
            else
            {
                _statusText.text += string.Format("{0}: {1}\n",
                                                  LocalizeManager.GetString("Mode"),
                                                  LocalizeManager.GetString("VideoCapture"));
            }
        }
 // Start is called before the first frame update
 private void Awake()
 {
     instance = this;
     SetLocale(languageKey);
 }