using UnityEditor;
using UnityEngine;
public class TestNotification : EditorWindow
{
private string notification = "This is a Notification";
static TestNotification window;
[MenuItem("Edit/Test")]
static void Test()
{
window = (TestNotification) EditorWindow.GetWindow(typeof(TestNotification));
window.Show();
}
private void OnGUI()
{
notification = EditorGUILayout.TextField(notification);
if (GUILayout.Button("Show Notification"))
{
window.ShowNotification(new GUIContent(notification));
}
if (GUILayout.Button("Remove Notification"))
{
window.RemoveNotification();
}
}
}
Unity 编辑器显示自定义提示界面
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
推荐阅读更多精彩内容
- 转自:http://www.xuanyusong.com/archives/3685比如编辑模式下对场景或者特定文...
- 转载:http://www.xuanyusong.com/archives/3685比如编辑模式下对场景或者特定文...
- 转载自:http://www.xuanyusong.com/archives/2211Unity支持自行创建窗口,...
- 2021/02/28更此次更新主要增加了给编辑器鼠标焦点处设置值方法 开始 最近产品上用到了代码编辑器,因为技术栈...