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(); } }