From 5a7b20958f2915ad29ed7a2afe062a0f20acced8 Mon Sep 17 00:00:00 2001 From: VladV Date: Mon, 9 May 2022 11:24:02 +0300 Subject: [PATCH] Hide header in reference type dropdown --- Editor/Utilities/TriManagedReferenceGui.cs | 2 ++ .../AdvancedDropdownProxy.cs | 12 ++++++++++++ .../AdvancedDropdownProxy.cs.meta | 3 +++ 3 files changed, 17 insertions(+) create mode 100644 Unity.InternalAPIEditorBridge.012/AdvancedDropdownProxy.cs create mode 100644 Unity.InternalAPIEditorBridge.012/AdvancedDropdownProxy.cs.meta diff --git a/Editor/Utilities/TriManagedReferenceGui.cs b/Editor/Utilities/TriManagedReferenceGui.cs index f037072..fa1ea0b 100644 --- a/Editor/Utilities/TriManagedReferenceGui.cs +++ b/Editor/Utilities/TriManagedReferenceGui.cs @@ -1,5 +1,6 @@ using System; using System.Linq; +using TriInspectorUnityInternalBridge; using UnityEditor; using UnityEditor.IMGUI.Controls; using UnityEngine; @@ -16,6 +17,7 @@ namespace TriInspector.Utilities { var dropdown = new ReferenceTypeDropDown(property, new AdvancedDropdownState()); dropdown.Show(rect); + AdvancedDropdownProxy.SetShowHeader(dropdown, false); Event.current.Use(); } } diff --git a/Unity.InternalAPIEditorBridge.012/AdvancedDropdownProxy.cs b/Unity.InternalAPIEditorBridge.012/AdvancedDropdownProxy.cs new file mode 100644 index 0000000..7df6761 --- /dev/null +++ b/Unity.InternalAPIEditorBridge.012/AdvancedDropdownProxy.cs @@ -0,0 +1,12 @@ +using UnityEditor.IMGUI.Controls; + +namespace TriInspectorUnityInternalBridge +{ + internal class AdvancedDropdownProxy + { + public static void SetShowHeader(AdvancedDropdown dropdown, bool showHeader) + { + dropdown.m_WindowInstance.showHeader = showHeader; + } + } +} \ No newline at end of file diff --git a/Unity.InternalAPIEditorBridge.012/AdvancedDropdownProxy.cs.meta b/Unity.InternalAPIEditorBridge.012/AdvancedDropdownProxy.cs.meta new file mode 100644 index 0000000..220ff4a --- /dev/null +++ b/Unity.InternalAPIEditorBridge.012/AdvancedDropdownProxy.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: fbe08837c89a44e29ea221ffeadb811d +timeCreated: 1652084409 \ No newline at end of file