Editor 记录

编程入门 行业动态 更新时间:2024-10-09 16:32:06

<a href=https://www.elefans.com/category/jswz/34/1763851.html style=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 记录

本文发布于:2024-02-13 06:37:42,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1757517.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Editor

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!