From 6b63d05c6e09078f2dc2cb0d54d0fa322be2ae4f Mon Sep 17 00:00:00 2001 From: Anders Ejlersen Date: Sun, 24 May 2026 13:36:50 +0200 Subject: [PATCH] 1.11.4: Fixed issue, where MethodButton didn't work in Unity 6+ --- Editor/ObjectEditor.cs | 11 +++++++++-- package.json | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Editor/ObjectEditor.cs b/Editor/ObjectEditor.cs index 7bc80e4..e35ddae 100644 --- a/Editor/ObjectEditor.cs +++ b/Editor/ObjectEditor.cs @@ -66,15 +66,22 @@ namespace Module.Inspector.Editor var position = new Rect(0, 0, 1, 1); +#if UNITY_2020_1_OR_NEWER && !UNITY_6000_1_OR_NEWER if (Event.current.type == EventType.Repaint) { position = GUILayoutUtility.GetLastRect(); position.y -= totalHeight; - #if UNITY_2020_1_OR_NEWER + position.width = EditorGUIUtility.currentViewWidth - 22.0f; - #endif } +#endif + +#if UNITY_6000_1_OR_NEWER + position = GUILayoutUtility.GetLastRect(); + position.y -= totalHeight; + position.width = EditorGUIUtility.currentViewWidth - 22.0f; +#endif position.y = position.yMax + EditorGUIUtility.singleLineHeight; position.height = EditorGUIUtility.singleLineHeight; diff --git a/package.json b/package.json index 67733bb..e482979 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "com.module.inspector", - "version": "1.11.3", + "version": "1.11.4", "displayName": "Module.Inspector", "description": "Custom inspector with various useful property drawers", "unity": "2019.2",