private void TranslateUIRayGameObject() { if (!isInitUIRayGameObject) { InitUIRayGameObject(); isInitUIRayGameObject = true; } else { RaycastHit[] raycastHits = GlobalVariables.GetGlobalVariables().physicsRaycast.mainCameraRaycastHits; if (raycastHits != null && raycastHits.Length > 0) { string text = ""; foreach (RaycastHit hitInfo in raycastHits) { if (hitInfo.collider != null) { GameObject gameObject = hitInfo.collider.gameObject; if (gameObject != null && gameObject.layer == 14) { string textMeshString = GameObjectUtil.GetGameObjectTextMeshString(gameObject); if (textMeshString != null && textMeshString.Trim().Length > 0) { text = translateText.TranslateString(textMeshString, TranslateText.DICT_UI); } } } } GUI.Label(new Rect(Input.mousePosition.x, (-Input.mousePosition.y), Screen.width, Screen.height), text, mouseTipGuiStyle); } } }