From c80dff43d03c0b8bd4af101662056c8054fe863d Mon Sep 17 00:00:00 2001 From: Jason Ma <1312119064@qq.com> Date: Wed, 13 Nov 2024 18:33:56 +0800 Subject: [PATCH] Optimize the display of Advanced Header --- Editor/LWGUI.cs | 6 +++++- package.json | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Editor/LWGUI.cs b/Editor/LWGUI.cs index 4a80396..d6ddfbc 100644 --- a/Editor/LWGUI.cs +++ b/Editor/LWGUI.cs @@ -132,10 +132,11 @@ public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] pro private void DrawAdvancedHeader(PropertyStaticData propStaticData, MaterialProperty prop) { + EditorGUILayout.Space(3); var rect = EditorGUILayout.GetControlRect(); var revertButtonRect = RevertableHelper.SplitRevertButtonRect(ref rect); var label = string.IsNullOrEmpty(propStaticData.advancedHeaderString) ? "Advanced" : propStaticData.advancedHeaderString; - propStaticData.isExpanding = EditorGUI.Foldout(rect, propStaticData.isExpanding, label); + propStaticData.isExpanding = EditorGUI.Foldout(rect, propStaticData.isExpanding, label, EditorStyles.foldoutHeader); if (Event.current.type == EventType.MouseDown && Event.current.button == 0 && rect.Contains(Event.current.mousePosition)) propStaticData.isExpanding = !propStaticData.isExpanding; RevertableHelper.DrawRevertableProperty(revertButtonRect, prop, metaDatas, true); @@ -146,6 +147,9 @@ private void DrawProperty(MaterialProperty prop) { var (propStaticData, propDynamicData) = metaDatas.GetPropDatas(prop); var materialEditor = metaDatas.GetMaterialEditor(); + + if (propStaticData.isAdvancedHeaderProperty) + EditorGUILayout.Space(3); Helper.DrawHelpbox(propStaticData, propDynamicData); diff --git a/package.json b/package.json index ee80e68..d7c74d8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "com.jasonma.lwgui", - "version": "1.19.3", + "version": "1.19.4", "displayName": "LWGUI", "description": "A Lightweight, Flexible, Powerful Shader GUI System for Unity.", "keywords": [