您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
29 行
775 B
29 行
775 B
using UnityEngine;
|
|
|
|
namespace UnityEditor.Experimental.ShaderTools.Internal
|
|
{
|
|
public static class UIUtils
|
|
{
|
|
const int k_MaxLogSize = ushort.MaxValue / 4 - 5;
|
|
static GUIContent s_TextContent = new GUIContent();
|
|
|
|
public static GUIContent Text(string text)
|
|
{
|
|
s_TextContent.text = text;
|
|
return s_TextContent;
|
|
}
|
|
|
|
public static GUIContent Text(string format, params object[] args)
|
|
{
|
|
s_TextContent.text = string.Format(format, args);
|
|
return s_TextContent;
|
|
}
|
|
|
|
public static string ClampText(string text)
|
|
{
|
|
return text.Length > k_MaxLogSize
|
|
? text.Substring(0, k_MaxLogSize)
|
|
: text;
|
|
}
|
|
}
|
|
}
|