Unity EditorWindow
来源:互联网 发布:如何做网站的seo 编辑:程序博客网 时间:2024/05/07 07:10
1.编辑器窗口
using UnityEngine;using System.Collections;using UnityEditor;public class DatabaseEditor : EditorWindow { private string text; private Texture m_texture; private static DatabaseEditor instance = null ; public int toolbarInt = 0; public string[] toolbarStrings = new string[] { "Toolbar1", "Toolbar2", "Toolbar3" }; public void Awake() { m_texture = Resources.Load("1") as Texture; if (m_texture == null) { Debug.Log("is null"); } } [MenuItem("Assets/OpenTheWindow")] public static void Init() { Rect wr = new Rect(0, 0, 1024, 768); DatabaseEditor window = (DatabaseEditor)EditorWindow.GetWindowWithRect(typeof(DatabaseEditor), wr, true, "WindowName"); window.Show(); } public void ShowErrorMessage(string msg) { Debug.LogError(msg); this.ShowNotification(new GUIContent(msg)); } void OnGUI() { GUI.DrawTexture(new Rect(0, 0, 1024, 768), m_texture); m_texture = EditorGUILayout.ObjectField("添加贴图", m_texture, typeof(Texture), true) as Texture; text = EditorGUILayout.TextField("输入文字:", text); toolbarInt = GUILayout.Toolbar(toolbarInt, toolbarStrings); GUILayout.Label("点击哪个Toggle:" + toolbarInt.ToString()); if (GUILayout.Button("打开通知", GUILayout.Width(200))) { //打开通知 this.ShowNotification(new GUIContent("This is a Notification")); } if (GUILayout.Button("关闭通知", GUILayout.Width(200))) { //关闭通知 this.RemoveNotification(); } if (GUILayout.Button("关闭窗口", GUILayout.Width(200))) { //关闭窗口 this.Close(); } }}
0 0
- Unity EditorWindow
- Unity EditorWindow Rename
- Unity之EditorWindow-window-一
- Unity之EditorWindow-Button-四
- Unity之EditorWindow-ScrollView-五
- Unity之EditorWindow-Notification-六
- Unity EditorWindow自定义弹出窗口
- Unity编辑器扩展之EditorWindow
- 【Unity编辑器】EditorWindow扩展-SubWindow
- EditorWindow
- unity当中editorwindow in front的奥秘
- Unity Editor 编辑器扩展 六 EditorWindow
- unity Editor EditorWindow Grid 使用 笔记
- 在Unity内制作工具(1)--MenuItem,Resouces.FindObjectsofTypeAll<>与EditorWindow自制编辑器窗口
- EditorWindow 和MenuItem
- 继承EditorWindow实现画布
- Unity3D EditorWindow一些小心得
- OnGUI---EditorWindow中的OnGUI事件
- 六级高频词汇(1)
- 可以通过无线路由的MAC地址找到你
- 主成分分析法
- Tensorflow-0-带GPU支持的安装与校验
- 〈颠覆营削〉让你的业销售绩提升5倍、10倍、50倍、100倍 ...
- Unity EditorWindow
- TensorFlow strides 参数讨论
- RDMA_CM API: 获取本地/远端的rdma_cm_id绑定的端口号
- 复习数据结构之选择排序
- Spark Client部署
- JavaScript:日期选择器组件的使用
- Linux命令
- 浅析静态规划和动态规划
- macpro2011年末机器换硬盘免装系统迁移数据