Unity除了自带的Project窗口,Scene窗口等,还支持自定义窗口。创建自定义窗口的步骤一般为: 创建一个从 EditorWindow 派生的脚本 使用代码触发窗口显示自身 为您的工具实现GUI代码 实例: publicclassMyWindow:EditorWindow{stringmyString="Hello World";boolgroupEnabled;boolmyBool=true;floatmyFloat=1.23f;// 创建菜单...
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...
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) { ...
右键窗口tab 窗口右上角菜单按钮 窗口都有默认的菜单项。。可以通过实现IHasCustomMenu接口中的AddItemsToMenu函数 来添加自定义的菜单项 代码: usingUnityEditor;usingUnityEngine;publicclassCustomMenuEditorWindow:EditorWindow,IHasCustomMenu{[MenuItem("Window/Custom Menu Window")]publicstaticvoidOpenCustomMenuWind...
"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...
window The Inspector window Editing properties The Toolbar The status bar The Background Tasks window Console Window Additional windows Undo Search in the Editor Customizing your workspace Unity shortcuts Save your work Editor Features Unity Search Input UI systems Animation Audio Video and cutscenes ...
首先继承自Editor类,使用CustomEditorAttribute,并重写OnInspectorGUI方法以实现自定义编辑器。 音频库名称是一个string类型字段,因此使用EditorGUILayout中的TextField函数来添加一个文本编辑框: usingUnityEditor;usingUnityEngine;[CustomEditor(typeof(AudioDatabase))]publicclassAudioDatabaseEditor:Editor{privateAudioDataba...
Unity中的窗口都可以通过右键窗口的tab 或者 点击窗口右上角的一个菜单按钮 来显示窗口菜单项。窗口都有默认的菜单项。但可以通过实现 IHasCustomMenu 接口中的 AddItemsToMenu 函数 来添加自定义的菜单项。 publicclassAssetBundleBrowserMain:EditorWindow,IHasCustomMenu{ ...
Use the Custom Rate Window from ShtoporGames on your next project. Find this GUI tool & more on the Unity Asset Store.
Strip Config Editor 程序实现: 1. 获取项目依赖的全部程序集: Build项目后Unity会在Library子目录生成程序集dll文件,不同目标平台生成的位置不同。HybridCLR会把目标平台生成的程序集单独拷贝出来存放在指定位置。我这里直接读取HybridCLR备份出来的全部程序集dll ...