mirror of
https://github.com/sinai-dev/UnityExplorer.git
synced 2025-06-15 13:57:31 +08:00
Fix vertices overflow on debug console, move UISyntaxHighlight
This commit is contained in:
parent
eb693eceb5
commit
7a4c7eb498
@ -29,6 +29,7 @@ namespace UnityExplorer.UI.Modules
|
||||
internal static readonly List<string> s_preInitMessages = new List<string>();
|
||||
|
||||
private InputField m_textInput;
|
||||
internal const int MAX_TEXT_LEN = 10000;
|
||||
|
||||
public DebugConsole(GameObject parent)
|
||||
{
|
||||
@ -102,7 +103,15 @@ namespace UnityExplorer.UI.Modules
|
||||
message = $"<color=#{hexColor}>{message}</color>";
|
||||
|
||||
if (Instance?.m_textInput)
|
||||
Instance.m_textInput.text = $"{message}\n{Instance.m_textInput.text}";
|
||||
{
|
||||
var input = Instance.m_textInput;
|
||||
var wanted = $"{message}\n{input.text}";
|
||||
|
||||
if (wanted.Length > MAX_TEXT_LEN)
|
||||
wanted = wanted.Substring(0, MAX_TEXT_LEN);
|
||||
|
||||
input.text = wanted;
|
||||
}
|
||||
else
|
||||
s_preInitMessages.Add(message);
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ using System.Reflection;
|
||||
using UnityEngine;
|
||||
using UnityExplorer.Unstrip;
|
||||
|
||||
namespace UnityExplorer.UI.Shared
|
||||
namespace UnityExplorer.UI
|
||||
{
|
||||
public class UISyntaxHighlight
|
||||
{
|
||||
@ -47,9 +47,7 @@ namespace UnityExplorer.UI.Shared
|
||||
{
|
||||
string ret = "";
|
||||
|
||||
if (type.IsGenericParameter
|
||||
|| type.GetGenericArguments().Any(it => it.IsGenericParameter)
|
||||
|| (type.HasElementType && type.GetElementType().IsGenericParameter))
|
||||
if (type.IsGenericParameter || (type.HasElementType && type.GetElementType().IsGenericParameter))
|
||||
{
|
||||
ret = $"<color={Enum}>{type.Name}</color>";
|
||||
}
|
@ -379,7 +379,7 @@
|
||||
<Compile Include="UI\Shared\InputFieldScroller.cs" />
|
||||
<Compile Include="UI\Shared\SliderScrollbar.cs" />
|
||||
<Compile Include="UI\Shared\PageHandler.cs" />
|
||||
<Compile Include="UI\Shared\UISyntaxHighlight.cs" />
|
||||
<Compile Include="UI\UISyntaxHighlight.cs" />
|
||||
<Compile Include="UI\UIManager.cs" />
|
||||
<Compile Include="Unstrip\AssetBundleUnstrip.cs" />
|
||||
<Compile Include="Unstrip\ColorUtilityUnstrip.cs" />
|
||||
|
Loading…
x
Reference in New Issue
Block a user