diff --git a/resources/cursor.png b/resources/cursor.png deleted file mode 100644 index 9cf09c9..0000000 Binary files a/resources/cursor.png and /dev/null differ diff --git a/resources/explorerui.bundle b/resources/explorerui.bundle new file mode 100644 index 0000000..c6acc12 Binary files /dev/null and b/resources/explorerui.bundle differ diff --git a/resources/tmp.bundle b/resources/tmp.bundle deleted file mode 100644 index f6141dd..0000000 Binary files a/resources/tmp.bundle and /dev/null differ diff --git a/src/Console/AutoCompleter.cs b/src/Console/AutoCompleter.cs index cdd5bf3..a9d43e3 100644 --- a/src/Console/AutoCompleter.cs +++ b/src/Console/AutoCompleter.cs @@ -129,47 +129,52 @@ namespace UnityExplorer.Console private static void UpdatePosition() { - var editor = ConsolePage.Instance.m_codeEditor; - - if (editor.InputField.text.Length < 1) + try { - return; - } + var editor = ConsolePage.Instance.m_codeEditor; - int caretPos = editor.InputField.caretPosition; - while (caretPos >= editor.inputText.textInfo.characterInfo.Length) - { - caretPos--; - } + var textGen = editor.inputText.cachedTextGenerator; - if (caretPos == m_lastCaretPos) - { - return; - } + //if (textGen.characters.Count < 1) + // return; - m_lastCaretPos = caretPos; + int caretPos = editor.InputField.caretPosition; - if (caretPos >= 0 && caretPos < editor.inputText.textInfo.characterInfo.Length) - { - var pos = editor.inputText.textInfo.characterInfo[caretPos].bottomLeft; + if (caretPos >= 1) + caretPos--; - pos = editor.InputField.transform.TransformPoint(pos); + if (caretPos < 0 || caretPos == m_lastCaretPos) + return; - // fix position when scrolled down - var scrollSize = editor.InputField.verticalScrollbar.size; - var scrollValue = editor.InputField.verticalScrollbar.value; + m_lastCaretPos = caretPos; - scrollSize += (1 - scrollSize) * (1 - scrollValue); + var pos = textGen.characters[caretPos].cursorPos; - if (!Mathf.Approximately(scrollSize, 1)) - { - var height = editor.InputField.textViewport.rect.height; + // todo this calculation isnt the right one to use. It's wrong if we hide the Debug Console. - pos.y += (1 / scrollSize * height) - height; - } + var posOffset = MainMenu.Instance.MainPanel.transform.position; + + pos = (Vector2)posOffset + pos + new Vector2(25, 35); + + //// fix position when scrolled down + //var scrollSize = editor.InputField.verticalScrollbar.size; + //var scrollValue = editor.InputField.verticalScrollbar.value; + + //scrollSize += (1 - scrollSize) * (1 - scrollValue); + + //if (!Mathf.Approximately(scrollSize, 1)) + //{ + // var height = editor.InputField.textViewport.rect.height; + + // pos.y += (1 / scrollSize * height) - height; + //} m_mainObj.transform.position = new Vector3(pos.x, pos.y - 3, 0); } + catch //(Exception e) + { + //ExplorerCore.Log(e.ToString()); + } } private static readonly char[] splitChars = new[] { '{', '}', ',', ';', '<', '>', '(', ')', '[', ']', '=', '|', '&', '?' }; @@ -307,7 +312,7 @@ namespace UnityExplorer.Console var hiddenChild = UIFactory.CreateUIObject("HiddenText", buttonObj); hiddenChild.SetActive(false); - var hiddenText = hiddenChild.AddComponent(); + var hiddenText = hiddenChild.AddGraphic(); m_hiddenSuggestionTexts.Add(hiddenText); #if CPP diff --git a/src/Console/CodeEditor.cs b/src/Console/CodeEditor.cs index ea6406c..2b129a8 100644 --- a/src/Console/CodeEditor.cs +++ b/src/Console/CodeEditor.cs @@ -3,7 +3,6 @@ using System.Linq; using System.Text; using UnityExplorer.Input; using UnityExplorer.Console.Lexer; -using TMPro; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; @@ -23,29 +22,20 @@ namespace UnityExplorer.Console { private readonly InputLexer inputLexer = new InputLexer(); - public TMP_InputField InputField { get; internal set; } + public InputField InputField { get; internal set; } - public TextMeshProUGUI inputText; - private TextMeshProUGUI inputHighlightText; - private TextMeshProUGUI lineText; + public Text inputText; + private Text inputHighlightText; private Image background; - private Image lineNumberBackground; private Image scrollbar; - //private readonly RectTransform inputTextTransform; - //private readonly RectTransform lineHighlightTransform; - //private bool lineHighlightLocked; - //private Image lineHighlight; - public int LineCount { get; private set; } public int CurrentLine { get; private set; } - public int CurrentColumn { get; private set; } public int CurrentIndent { get; private set; } private static readonly StringBuilder highlightedBuilder = new StringBuilder(4096); - private static readonly StringBuilder lineBuilder = new StringBuilder(); - private static readonly KeyCode[] lineChangeKeys = + private static readonly KeyCode[] onFocusKeys = { KeyCode.Return, KeyCode.Backspace, KeyCode.UpArrow, KeyCode.DownArrow, KeyCode.LeftArrow, KeyCode.RightArrow @@ -69,7 +59,7 @@ namespace UnityExplorer.Console inputHighlightText.text = string.Empty; } - inputText.ForceMeshUpdate(false); + //inputText.ForceMeshUpdate(false); } } @@ -98,14 +88,6 @@ The following helper methods are available: { ConstructUI(); - if (!AllReferencesAssigned()) - { - throw new Exception("References are missing!"); - } - - //inputTextTransform = inputText.GetComponent(); - //lineHighlightTransform = lineHighlight.GetComponent(); - ApplyTheme(); inputLexer.UseMatchers(CSharpLexer.DelimiterSymbols, CSharpLexer.Matchers); @@ -113,7 +95,7 @@ The following helper methods are available: #if CPP InputField.onValueChanged.AddListener(new Action((string s) => { OnInputChanged(); })); #else - this.InputField.onValueChanged.AddListener((string s) => { OnInputChanged(); }); + this.InputField.onValueChanged.AddListener((string s) => { OnInputChanged(s); }); #endif } @@ -125,12 +107,12 @@ The following helper methods are available: AutoIndentCaret(); } - if (EventSystem.current?.currentSelectedGameObject?.name == "InputField (TMP)") + if (EventSystem.current?.currentSelectedGameObject?.name == "InputField") { bool focusKeyPressed = false; // Check for any focus key pressed - foreach (KeyCode key in lineChangeKeys) + foreach (KeyCode key in onFocusKeys) { if (InputManager.GetKeyDown(key)) { @@ -139,20 +121,18 @@ The following helper methods are available: } } - // Update line highlight if (focusKeyPressed || InputManager.GetMouseButton(0)) { - //UpdateHighlight(); ConsolePage.Instance.OnInputChanged(); } } } - public void OnInputChanged(bool forceUpdate = false) + public void OnInputChanged(string newInput, bool forceUpdate = false) { - string newText = InputField.text; + string newText = newInput; - UpdateIndent(); + UpdateIndent(newInput); if (!forceUpdate && string.IsNullOrEmpty(newText)) { @@ -163,153 +143,40 @@ The following helper methods are available: inputHighlightText.text = SyntaxHighlightContent(newText); } - UpdateLineNumbers(); - //UpdateHighlight(); - ConsolePage.Instance.OnInputChanged(); } - //public void SetLineHighlight(int lineNumber, bool lockLineHighlight) - //{ - // if (lineNumber < 1 || lineNumber > LineCount) - // { - // return; - // } - - // lineHighlightTransform.anchoredPosition = new Vector2(5, - // (inputText.textInfo.lineInfo[inputText.textInfo.characterInfo[0].lineNumber].lineHeight * - // //-(lineNumber - 1)) - 4f + - // -(lineNumber - 1)) + - // inputTextTransform.anchoredPosition.y); - - // lineHighlightLocked = lockLineHighlight; - //} - - private void UpdateLineNumbers() - { - int currentLineCount = inputText.textInfo.lineCount; - - int currentLineNumber = 1; - - if (currentLineCount != LineCount) - { - try - { - lineBuilder.Length = 0; - - for (int i = 1; i < currentLineCount + 2; i++) - { - if (i - 1 > 0 && i - 1 < currentLineCount - 1) - { - int characterStart = inputText.textInfo.lineInfo[i - 1].firstCharacterIndex; - int characterCount = inputText.textInfo.lineInfo[i - 1].characterCount; - - if (characterStart >= 0 && characterStart < inputText.text.Length && - characterCount != 0 && !inputText.text.Substring(characterStart, characterCount).Contains("\n")) - { - lineBuilder.Append("\n"); - continue; - } - } - - lineBuilder.Append(currentLineNumber); - lineBuilder.Append('\n'); - - currentLineNumber++; - - if (i - 1 == 0 && i - 1 < currentLineCount - 1) - { - int characterStart = inputText.textInfo.lineInfo[i - 1].firstCharacterIndex; - int characterCount = inputText.textInfo.lineInfo[i - 1].characterCount; - - if (characterStart >= 0 && characterStart < inputText.text.Length && - characterCount != 0 && !inputText.text.Substring(characterStart, characterCount).Contains("\n")) - { - lineBuilder.Append("\n"); - continue; - } - } - } - - lineText.text = lineBuilder.ToString(); - LineCount = currentLineCount; - } - catch { } - } - } - - private void UpdateIndent() + private void UpdateIndent(string newText) { int caret = InputField.caretPosition; - if (caret < 0 || caret >= inputText.textInfo.characterInfo.Length) + int len = newText.Length; + if (caret < 0 || caret >= len) { - while (caret >= 0 && caret >= inputText.textInfo.characterInfo.Length) - { + while (caret >= 0 && caret >= len) caret--; - } - if (caret < 0 || caret >= inputText.textInfo.characterInfo.Length) - { + if (caret < 0) return; - } } - CurrentLine = inputText.textInfo.characterInfo[caret].lineNumber; - - int charCount = 0; - for (int i = 0; i < CurrentLine; i++) - { - charCount += inputText.textInfo.lineInfo[i].characterCount; - } - - CurrentColumn = caret - charCount; CurrentIndent = 0; - for (int i = 0; i < caret && i < InputField.text.Length; i++) + for (int i = 0; i < caret && i < newText.Length; i++) { - char character = InputField.text[i]; + char character = newText[i]; if (character == CSharpLexer.indentIncreaseCharacter) - { CurrentIndent++; - } if (character == CSharpLexer.indentDecreaseCharacter) - { CurrentIndent--; - } } if (CurrentIndent < 0) - { CurrentIndent = 0; - } } - //private void UpdateHighlight() - //{ - // if (lineHighlightLocked) - // { - // return; - // } - - // try - // { - // int caret = InputField.caretPosition - 1; - - // float lineHeight = inputText.textInfo.lineInfo[inputText.textInfo.characterInfo[0].lineNumber].lineHeight; - // int lineNumber = inputText.textInfo.characterInfo[caret].lineNumber; - // float offset = lineNumber + inputTextTransform.anchoredPosition.y; - - // lineHighlightTransform.anchoredPosition = new Vector2(5, -(offset * lineHeight)); - // } - // catch //(Exception e) - // { - // //ExplorerCore.LogWarning("Exception on Update Line Highlight: " + e); - // } - //} - private const string CLOSE_COLOR_TAG = ""; private string SyntaxHighlightContent(string inputText) @@ -325,7 +192,7 @@ The following helper methods are available: highlightedBuilder.Append(inputText[i]); } - highlightedBuilder.Append(match.htmlColor); + highlightedBuilder.Append($"{match.htmlColor}"); for (int i = match.startIndex; i < match.endIndex; i++) { @@ -388,20 +255,21 @@ The following helper methods are available: // insert the actual auto indent now InputField.text = InputField.text.Insert(caretPos, indent); - InputField.stringPosition = caretPos + indent.Length; + //InputField.stringPosition = caretPos + indent.Length; + InputField.caretPosition = caretPos + indent.Length; } } // Update line column and indent positions - UpdateIndent(); + UpdateIndent(InputField.text); inputText.text = InputField.text; - inputText.SetText(InputField.text, true); + //inputText.SetText(InputField.text, true); inputText.Rebuild(CanvasUpdate.Prelayout); InputField.ForceLabelUpdate(); InputField.Rebuild(CanvasUpdate.Prelayout); - OnInputChanged(true); + OnInputChanged(inputText.text, true); } private string GetAutoIndentTab(int amount) @@ -418,12 +286,7 @@ The following helper methods are available: // ============== Theme ============== // - private static Color caretColor = new Color32(255, 255, 255, 255); - private static Color textColor = new Color32(255, 255, 255, 255); private static Color backgroundColor = new Color32(37, 37, 37, 255); - //private static Color lineHighlightColor = new Color32(50, 50, 50, 255); - private static Color lineNumberBackgroundColor = new Color32(25, 25, 25, 255); - private static Color lineNumberTextColor = new Color32(180, 180, 180, 255); private static Color scrollbarColor = new Color32(45, 50, 50, 255); private void ApplyTheme() @@ -434,34 +297,13 @@ The following helper methods are available: highlightTextRect.offsetMin = Vector2.zero; highlightTextRect.offsetMax = Vector2.zero; - InputField.caretColor = caretColor; - inputText.color = textColor; - inputHighlightText.color = textColor; + InputField.caretColor = Color.white; + inputText.color = new Color(1, 1, 1, 0.51f); + inputHighlightText.color = Color.white; background.color = backgroundColor; - //lineHighlight.color = lineHighlightColor; - lineNumberBackground.color = lineNumberBackgroundColor; - lineText.color = lineNumberTextColor; scrollbar.color = scrollbarColor; } - private bool AllReferencesAssigned() - { - if (!InputField || - !inputText || - !inputHighlightText || - !lineText || - !background || - //!lineHighlight || - !lineNumberBackground || - !scrollbar) - { - // One or more references are not assigned - return false; - } - return true; - } - - // ========== UI CONSTRUCTION =========== // public void ConstructUI() @@ -589,81 +431,38 @@ The following helper methods are available: mainBgRect.offsetMin = Vector2.zero; mainBgRect.offsetMax = Vector2.zero; - var mainBgImage = mainBg.AddComponent(); + var mainBgImage = mainBg.AddGraphic(); - //var lineHighlight = UIFactory.CreateUIObject("LineHighlight", consoleBase); + var inputObj = UIFactory.CreateInputField(consoleBase, 14, 0); - //var lineHighlightRect = lineHighlight.GetComponent(); - //lineHighlightRect.pivot = new Vector2(0.5f, 1); - //lineHighlightRect.anchorMin = new Vector2(0, 1); - //lineHighlightRect.anchorMax = new Vector2(1, 1); - //lineHighlightRect.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, 21); - - //var lineHighlightImage = lineHighlight.GetComponent(); - //if (!lineHighlightImage) - //{ - // lineHighlightImage = lineHighlight.AddComponent(); - //} - - var linesBg = UIFactory.CreateUIObject("LinesBackground", consoleBase); - var linesBgRect = linesBg.GetComponent(); - linesBgRect.anchorMin = Vector2.zero; - linesBgRect.anchorMax = new Vector2(0, 1); - linesBgRect.offsetMin = new Vector2(-17.5f, 0); - linesBgRect.offsetMax = new Vector2(17.5f, 0); - linesBgRect.sizeDelta = new Vector2(65, 0); - - var linesBgImage = linesBg.AddComponent(); - - var inputObj = UIFactory.CreateTMPInput(consoleBase); - - var inputField = inputObj.GetComponent(); - inputField.richText = false; - inputField.restoreOriginalTextOnEscape = false; + var inputField = inputObj.GetComponent(); + //inputField.richText = false; + //inputField.restoreOriginalTextOnEscape = false; var inputRect = inputObj.GetComponent(); - inputRect.pivot = new Vector2(0.5f, 0.5f); + inputRect.pivot = new Vector2(0, 1); inputRect.anchorMin = Vector2.zero; - inputRect.anchorMax = new Vector2(0.92f, 1); + inputRect.anchorMax = Vector2.one; inputRect.offsetMin = new Vector2(20, 0); inputRect.offsetMax = new Vector2(14, 0); - inputRect.anchoredPosition = new Vector2(40, 0); - var textAreaObj = inputObj.transform.Find("TextArea"); - var textAreaRect = textAreaObj.GetComponent(); - textAreaRect.pivot = new Vector2(0.5f, 0.5f); - textAreaRect.anchorMin = Vector2.zero; - textAreaRect.anchorMax = Vector2.one; + var mainTextObj = inputField.textComponent.gameObject; - var mainTextObj = textAreaObj.transform.Find("Text"); - var mainTextRect = mainTextObj.GetComponent(); - mainTextRect.pivot = new Vector2(0.5f, 0.5f); - mainTextRect.anchorMin = Vector2.zero; - mainTextRect.anchorMax = Vector2.one; - mainTextRect.offsetMin = Vector2.zero; - mainTextRect.offsetMax = Vector2.zero; + var mainTextInput = mainTextObj.GetComponent(); - var mainTextInput = mainTextObj.GetComponent(); - //mainTextInput.fontSize = 18; - - var placeHolderText = textAreaObj.transform.Find("Placeholder").GetComponent(); - placeHolderText.text = CodeEditor.STARTUP_TEXT; - - var linesTextObj = UIFactory.CreateUIObject("LinesText", mainTextObj.gameObject); - var linesTextRect = linesTextObj.GetComponent(); - - var linesTextInput = linesTextObj.AddComponent(); - linesTextInput.fontSize = 18; + var placeHolderText = inputField.placeholder.GetComponent(); + placeHolderText.text = STARTUP_TEXT; var highlightTextObj = UIFactory.CreateUIObject("HighlightText", mainTextObj.gameObject); var highlightTextRect = highlightTextObj.GetComponent(); + highlightTextRect.pivot = new Vector2(0, 1); highlightTextRect.anchorMin = Vector2.zero; highlightTextRect.anchorMax = Vector2.one; - highlightTextRect.offsetMin = Vector2.zero; - highlightTextRect.offsetMax = Vector2.zero; + highlightTextRect.offsetMin = new Vector2(20, 0); + highlightTextRect.offsetMax = new Vector2(14, 0); - var highlightTextInput = highlightTextObj.AddComponent(); - //highlightTextInput.fontSize = 18; + var highlightTextInput = highlightTextObj.AddGraphic(); + highlightTextInput.supportRichText = true; var scroll = UIFactory.CreateScrollbar(consoleBase); @@ -681,19 +480,7 @@ The following helper methods are available: var scrollImage = scroll.GetComponent(); - var tmpInput = inputObj.GetComponent(); - tmpInput.scrollSensitivity = 15; - tmpInput.verticalScrollbar = scroller; - - // set lines text anchors here after UI is fleshed out - linesTextRect.pivot = Vector2.zero; - linesTextRect.anchorMin = new Vector2(0, 0); - linesTextRect.anchorMax = new Vector2(1, 1); - linesTextRect.offsetMin = Vector2.zero; - linesTextRect.offsetMax = Vector2.zero; - linesTextRect.anchoredPosition = new Vector2(-40, 0); - - tmpInput.GetComponentInChildren().enabled = false; + inputField.GetComponentInChildren().enabled = false; inputObj.GetComponent().enabled = false; #endregion @@ -723,66 +510,18 @@ The following helper methods are available: #endif void CompileCallback() { - if (!string.IsNullOrEmpty(tmpInput.text)) + if (!string.IsNullOrEmpty(inputField.text)) { - ConsolePage.Instance.Evaluate(tmpInput.text.Trim()); + ConsolePage.Instance.Evaluate(inputField.text.Trim()); } } #endregion - #region FONT + mainTextInput.supportRichText = false; - TMP_FontAsset fontToUse = UIManager.ConsoleFont; - if (fontToUse == null) - { -#if CPP - UnityEngine.Object[] fonts = ResourcesUnstrip.FindObjectsOfTypeAll(Il2CppType.Of()); - foreach (UnityEngine.Object font in fonts) - { - TMP_FontAsset fontCast = font.Il2CppCast(typeof(TMP_FontAsset)) as TMP_FontAsset; - - if (fontCast.name.Contains("LiberationSans")) - { - fontToUse = fontCast; - break; - } - } -#else - var fonts = Resources.FindObjectsOfTypeAll(); - foreach (var font in fonts) - { - if (font.name.Contains("LiberationSans")) - { - fontToUse = font; - break; - } - } -#endif - } - - if (fontToUse != null) - { - UnityEngine.TextCore.FaceInfo faceInfo = fontToUse.faceInfo; - fontToUse.tabSize = 10; - faceInfo.tabWidth = 10; -#if CPP - fontToUse.faceInfo = faceInfo; -#else - typeof(TMP_FontAsset) - .GetField("m_FaceInfo", BindingFlags.NonPublic | BindingFlags.Instance) - .SetValue(fontToUse, faceInfo); -#endif - - tmpInput.fontAsset = fontToUse; - - mainTextInput.font = fontToUse; - mainTextInput.fontSize = 18; - - highlightTextInput.font = fontToUse; - highlightTextInput.fontSize = 18; - } - #endregion + mainTextInput.font = UIManager.ConsoleFont; + highlightTextInput.font = UIManager.ConsoleFont; // assign references @@ -790,10 +529,7 @@ The following helper methods are available: this.inputText = mainTextInput; this.inputHighlightText = highlightTextInput; - this.lineText = linesTextInput; this.background = mainBgImage; - //this.lineHighlight = lineHighlightImage; - this.lineNumberBackground = linesBgImage; this.scrollbar = scrollImage; } } diff --git a/src/Console/Lexer/Matcher.cs b/src/Console/Lexer/Matcher.cs index 1ff7f7f..7f58df6 100644 --- a/src/Console/Lexer/Matcher.cs +++ b/src/Console/Lexer/Matcher.cs @@ -8,7 +8,7 @@ namespace UnityExplorer.Console.Lexer { public abstract Color HighlightColor { get; } - public string HexColor => htmlColor ?? (htmlColor = "<#" + HighlightColor.ToHex() + ">"); + public string HexColor => htmlColor ?? (htmlColor = ""); private string htmlColor = null; public virtual IEnumerable StartChars { get { yield break; } } diff --git a/src/Inspectors/GameObjectInspector.cs b/src/Inspectors/GameObjectInspector.cs index b27fedf..38213cf 100644 --- a/src/Inspectors/GameObjectInspector.cs +++ b/src/Inspectors/GameObjectInspector.cs @@ -4,7 +4,7 @@ using System.Linq; using UnityExplorer.Helpers; using UnityExplorer.UI; using UnityExplorer.Unstrip; -using TMPro; +//using TMPro; using UnityEngine; using UnityEngine.UI; using UnityExplorer.Inspectors.GameObjects; @@ -36,10 +36,10 @@ namespace UnityExplorer.Inspectors } private static string m_lastName; - public static TMP_InputField m_nameInput; + public static InputField m_nameInput; private static string m_lastPath; - public static TMP_InputField m_pathInput; + public static InputField m_pathInput; private static RectTransform m_pathInputRect; private static GameObject m_pathGroupObj; private static Text m_hiddenPathText; @@ -271,7 +271,7 @@ namespace UnityExplorer.Inspectors m_hiddenPathText = pathHiddenTextObj.GetComponent(); m_hiddenPathText.color = Color.clear; m_hiddenPathText.fontSize = 14; - m_hiddenPathText.lineSpacing = 1.5f; + //m_hiddenPathText.lineSpacing = 1.5f; m_hiddenPathText.raycastTarget = false; var hiddenFitter = pathHiddenTextObj.AddComponent(); hiddenFitter.verticalFit = ContentSizeFitter.FitMode.PreferredSize; @@ -286,10 +286,10 @@ namespace UnityExplorer.Inspectors hiddenGroup.childForceExpandHeight = true; hiddenGroup.childControlHeight = true; - var pathInputObj = UIFactory.CreateTMPInput(pathHiddenTextObj, 14, 0, (int)TextAlignmentOptions.MidlineLeft); + var pathInputObj = UIFactory.CreateInputField(pathHiddenTextObj); var pathInputRect = pathInputObj.GetComponent(); pathInputRect.sizeDelta = new Vector2(pathInputRect.sizeDelta.x, 25); - m_pathInput = pathInputObj.GetComponent(); + m_pathInput = pathInputObj.GetComponent(); m_pathInput.text = TargetGO.transform.GetTransformPath(); m_pathInput.readOnly = true; var pathInputLayout = pathInputObj.AddComponent(); @@ -301,7 +301,7 @@ namespace UnityExplorer.Inspectors textRect.offsetMin = new Vector2(3, 3); textRect.offsetMax = new Vector2(3, 3); m_pathInput.textComponent.color = new Color(0.75f, 0.75f, 0.75f); - m_pathInput.textComponent.lineSpacing = 1.5f; + //m_pathInput.textComponent.lineSpacing = 1.5f; m_pathInputRect = m_pathInput.GetComponent(); m_hiddenPathRect = m_hiddenPathText.GetComponent(); @@ -321,8 +321,8 @@ namespace UnityExplorer.Inspectors nameLayout.minHeight = 25; nameLayout.flexibleHeight = 0; - var nameTextObj = UIFactory.CreateTMPLabel(nameRowObj, TextAlignmentOptions.Midline); - var nameTextText = nameTextObj.GetComponent(); + var nameTextObj = UIFactory.CreateLabel(nameRowObj, TextAnchor.MiddleCenter); + var nameTextText = nameTextObj.GetComponent(); nameTextText.text = "Name:"; nameTextText.fontSize = 14; nameTextText.color = Color.grey; @@ -332,12 +332,12 @@ namespace UnityExplorer.Inspectors nameTextLayout.minWidth = 55; nameTextLayout.flexibleWidth = 0; - var nameInputObj = UIFactory.CreateTMPInput(nameRowObj, 14, 0, (int)TextAlignmentOptions.MidlineLeft); + var nameInputObj = UIFactory.CreateInputField(nameRowObj); var nameInputRect = nameInputObj.GetComponent(); nameInputRect.sizeDelta = new Vector2(nameInputRect.sizeDelta.x, 25); - m_nameInput = nameInputObj.GetComponent(); + m_nameInput = nameInputObj.GetComponent(); m_nameInput.text = TargetGO.name; - m_nameInput.lineType = TMP_InputField.LineType.SingleLine; + m_nameInput.lineType = InputField.LineType.SingleLine; var applyNameBtnObj = UIFactory.CreateButton(nameRowObj); var applyNameBtn = applyNameBtnObj.GetComponent