Editor 记录"/>
Editor 记录
Editor 记录
常用效果记录
一
1. 下拉选择框
EditorGUILayout.Foldout
2. 移位包含
enum ExampleFlagsEnum
{None = 0, // Custom name for "Nothing" optionA = 1 << 0,B = 1 << 1,AB = A | B, // Combination of two flagsC = 1 << 2,All = ~0, // Custom name for "Everything" option
}
3.检视面板标题栏
EditorGUI.InspectorTitlebar
4. 消息视窗
EditorGUILayout.HelpBox("xxx!\n " + PushError, MessageType.Warning);
5. 缩进
EditorGUI.indentLevel ++; = 3 (EditorGUILoayout) 使用有效, 其他需要 GUILayout.Space(16);
6.画图
GUI.DrawTexture(stateR, tx);
GUILayout.Button(m_Texture, GUIStyle.none);
7. 加载系统图标
UnityEditor.EditorGUIUtility.FindTexture("PrefabVariant Icon");
8.弹窗选择界面
PopupWindow
9.绘制颜色
EditorGUI.DrawRect
10.监听点击
if (Event.current.type == EventType.MouseDown && rect.Contains(Event.current.mousePosition))
11. windows 界面刷新
void OnInspectorUpdate(){Repaint();}
6. 定位显示project 中物体
EditorGUIUtility.PingObject(obj);
更多推荐
Editor 记录
发布评论