From 962b33e35559f82c58927086404135fa6ffda269 Mon Sep 17 00:00:00 2001 From: Mikhail <99481254+DCFApixels@users.noreply.github.com> Date: Sat, 15 Jun 2024 19:30:59 +0800 Subject: [PATCH] update --- src/EntityTemplate/Editor/ComponentTemplatePropertyDrawer.cs | 2 ++ src/Internal/Editor/EcsGUI.cs | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/EntityTemplate/Editor/ComponentTemplatePropertyDrawer.cs b/src/EntityTemplate/Editor/ComponentTemplatePropertyDrawer.cs index 9d547b4..80639e6 100644 --- a/src/EntityTemplate/Editor/ComponentTemplatePropertyDrawer.cs +++ b/src/EntityTemplate/Editor/ComponentTemplatePropertyDrawer.cs @@ -192,6 +192,7 @@ namespace DCFApixels.DragonECS.Unity.Editors optionButton.yMax += HeadIconsRect.height; optionButton.xMin = optionButton.xMax - 64; optionButton.center += Vector2.up * Padding * 1f; + //Canceling isExpanded if (EcsGUI.HitTest(optionButton) && Event.current.type == EventType.MouseUp) { componentProperty.isExpanded = !componentProperty.isExpanded; @@ -218,6 +219,7 @@ namespace DCFApixels.DragonECS.Unity.Editors EcsGUI.DescriptionIcon(optionButton, description); } + if (propCount <= 0) { EcsGUI.DrawEmptyComponentProperty(paddingPosition, componentRefProp, label, false); diff --git a/src/Internal/Editor/EcsGUI.cs b/src/Internal/Editor/EcsGUI.cs index a91ee23..b5566f8 100644 --- a/src/Internal/Editor/EcsGUI.cs +++ b/src/Internal/Editor/EcsGUI.cs @@ -599,13 +599,13 @@ namespace DCFApixels.DragonECS.Unity.Editors optionButton.yMax += HeadIconsRect.height; optionButton.xMin = optionButton.xMax - 64; optionButton.center += Vector2.up * padding * 2f; + //Canceling isExpanded if (HitTest(optionButton) && Event.current.type == EventType.MouseUp) { ref bool isExpanded = ref expandMatrix.Down(); isExpanded = !isExpanded; } - GUILayout.BeginVertical(UnityEditorUtility.GetStyle(panelColor, EscEditorConsts.COMPONENT_DRAWER_ALPHA)); EditorGUI.BeginChangeCheck(); @@ -635,7 +635,6 @@ namespace DCFApixels.DragonECS.Unity.Editors pool.SetRaw(entityID, resultData); } - GUILayout.EndVertical(); } }