using UnityEngine;
using UnityEditor;
public class MyEditorStyleWindow : EditorWindow {
Vector2 scrollPosition = new Vector2(0,0);
string search = "";
[MenuItem(("Window/MyEditor Style Viewer"))]
public static void Init(){
MyEditorStyleWindow window=(MyEditorStyleWindow)EditorWindow.GetWindow(typeof(MyEditorStyleWindow));
window.titleContent = new GUIContent ("EditorStyleViewer");
}
void OnGUI(){
GUILayout.BeginHorizontal("HelpBox");
GUILayout.Label("Click a Sample to copy its Name to your Clipboard","MiniBoldLabel");
GUILayout.FlexibleSpace();
GUILayout.Label("Search:");
search = EditorGUILayout.TextField(search);
GUILayout.EndHorizontal();
scrollPosition = GUILayout.BeginScrollView(scrollPosition);
foreach(GUIStyle style in GUI.skin.customStyles){
if(style.name
Unity 获取EditorStyles
最新推荐文章于 2022-01-17 18:49:25 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)