From 9ff5931878bae3ea467787a8d266884805e03a5a Mon Sep 17 00:00:00 2001 From: uurha Date: Fri, 12 Jul 2024 19:18:15 +0000 Subject: [PATCH] Merge pull request #125 from techno-dwarf-works/feature/refactoring Version 3.1.5 --- .../{BetterButtonsEditor.cs => ButtonsEditor.cs} | 10 +++++++--- ...tterButtonsEditor.cs.meta => ButtonsEditor.cs.meta} | 0 .../EditorAddons/Drawers/Gizmo/HideTransformDrawer.cs | 6 +++++- package.json | 2 +- 4 files changed, 13 insertions(+), 5 deletions(-) rename Editor/EditorAddons/CustomEditors/{BetterButtonsEditor.cs => ButtonsEditor.cs} (90%) rename Editor/EditorAddons/CustomEditors/{BetterButtonsEditor.cs.meta => ButtonsEditor.cs.meta} (100%) diff --git a/Editor/EditorAddons/CustomEditors/BetterButtonsEditor.cs b/Editor/EditorAddons/CustomEditors/ButtonsEditor.cs similarity index 90% rename from Editor/EditorAddons/CustomEditors/BetterButtonsEditor.cs rename to Editor/EditorAddons/CustomEditors/ButtonsEditor.cs index cfc45a7..2bebc90 100644 --- a/Editor/EditorAddons/CustomEditors/BetterButtonsEditor.cs +++ b/Editor/EditorAddons/CustomEditors/ButtonsEditor.cs @@ -15,12 +15,12 @@ namespace Better.Attributes.EditorAddons.CustomEditors { [MultiEditor(typeof(Object), true, Order = 999)] - public class BetterButtonsEditor : ExtendedEditor + public class ButtonsEditor : ExtendedEditor { private Dictionary>> _methodButtonsAttributes = new Dictionary>>(); - public BetterButtonsEditor(Object target, SerializedObject serializedObject) : base(target, serializedObject) + public ButtonsEditor(Object target, SerializedObject serializedObject) : base(target, serializedObject) { } @@ -38,8 +38,10 @@ private Button DrawButton(MethodInfo methodInfo, EditorButtonAttribute attribute { var button = new Button { - text = attribute.GetDisplayName(methodInfo.PrettyMemberName()) + text = attribute.GetDisplayName(methodInfo.PrettyMemberName()), + name = methodInfo.PrettyMemberName() }; + button.style.FlexGrow(StyleDefinition.OneStyleFloat); button.RegisterCallback(OnClick, (methodInfo, attribute)); return button; } @@ -64,6 +66,7 @@ private VisualElement DrawButtons(Dictionary key.Key, pair => pair.Value, (info, attributes) => new KeyValuePair>(info, attributes)); var verticalElement = VisualElementUtility.CreateVerticalGroup(); + container.Add(verticalElement); foreach (var group in grouped) { @@ -80,6 +83,7 @@ private VisualElement DrawButtons(Dictionary(OnClicked, button); return button; } diff --git a/package.json b/package.json index 51af3c9..4ee7b05 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "com.uurha.betterattributes", "displayName": "Better Attributes", - "version": "3.1.4", + "version": "3.1.5", "unity": "2021.3", "description": "Unity attributes, allows to serialize interfaces, draw handles for Vector3/Vector2/Quaternion/Bounds, create read only fields.", "dependencies": {