Unity除了自带的Project窗口,Scene窗口等,还支持自定义窗口。创建自定义窗口的步骤一般为: 创建一个从 EditorWindow 派生的脚本 使用代码触发窗口显示自身 为您的工具实现GUI代码 实例: publicclassMyWindow:EditorWindow{stringmyString="Hello World";boolgroupEnabled;boolmyBool=true;floatmyFloat=1.23f;// 创建菜单...
右键窗口tab 窗口右上角菜单按钮 窗口都有默认的菜单项。。可以通过实现IHasCustomMenu接口中的AddItemsToMenu函数 来添加自定义的菜单项 代码: usingUnityEditor;usingUnityEngine;publicclassCustomMenuEditorWindow:EditorWindow,IHasCustomMenu{[MenuItem("Window/Custom Menu Window")]publicstaticvoidOpenCustomMenuWind...
using UnityEngine; // Temporary ScriptableObject used by the Preset system public class MyWindowSettings : ScriptableObject { [SerializeField] string m_SomeSettings; public void Init(MyEditorWindow window) { m_SomeSettings = window.someSettings; } public void ApplySettings(MyEditorWindow window) { ...
using UnityEditor; using UnityEngine; using UnityEngine.UIElements; namespace UIToolkitExamples { [CustomPropertyDrawer(typeof(Temperature))] public class TemperatureDrawer : PropertyDrawer { public override VisualElement CreatePropertyGUI(SerializedProperty property) { var asset = Resources.Load<VisualTreeAs...
"Invalid editor window UnityEditor.FallbackEditorWindow" error when using 'Maximize On Play' with custom Editor windows Themes - May 12, 2016 Steps to reproduce: 1) Open the attached project (796252_easy_repro.zip). - Don't change the layout. 2) Enable 'Maximize On Play'...
首先继承自Editor类,使用CustomEditorAttribute,并重写OnInspectorGUI方法以实现自定义编辑器。 音频库名称是一个string类型字段,因此使用EditorGUILayout中的TextField函数来添加一个文本编辑框: usingUnityEditor;usingUnityEngine;[CustomEditor(typeof(AudioDatabase))]publicclassAudioDatabaseEditor:Editor{privateAudioDataba...
Unity中的窗口都可以通过右键窗口的tab 或者 点击窗口右上角的一个菜单按钮 来显示窗口菜单项。窗口都有默认的菜单项。但可以通过实现 IHasCustomMenu 接口中的 AddItemsToMenu 函数 来添加自定义的菜单项。 publicclassAssetBundleBrowserMain:EditorWindow,IHasCustomMenu{ ...
Strip Config Editor 程序实现: 1. 获取项目依赖的全部程序集: Build项目后Unity会在Library子目录生成程序集dll文件,不同目标平台生成的位置不同。HybridCLR会把目标平台生成的程序集单独拷贝出来存放在指定位置。我这里直接读取HybridCLR备份出来的全部程序集dll ...
UI Toolkit is Unity's new retained-mode GUI solution to help with both editor GUI and runtime UI creation. At the time of writing, the UI Toolkit for runtime is still in preview and under active development. However, it is usable for editor GUI authoring and has many new features plus...
Event Profiler editor window EnumMask enum attribute InputManager methods SaveManager methods-Tutorial Screenshot methods and editor tools Download latestCandyCoded.unitypackageorCandyCoded.dll https://docs.unity3d.com/Packages/com.unity.package-manager-ui@2.0/manual/index.html ...