From 1f76157be044b04ec58e0c20b4e78058fd65d1b2 Mon Sep 17 00:00:00 2001 From: yellowisher Date: Thu, 25 Aug 2022 00:00:26 +0900 Subject: [PATCH] Force nesting when there is any sub menu in AddTypeMenu attribute. --- .../Editor/AdvancedTypePopup.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Editor/AdvancedTypePopup.cs b/Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Editor/AdvancedTypePopup.cs index 219dc50..b8bff65 100644 --- a/Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Editor/AdvancedTypePopup.cs +++ b/Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Editor/AdvancedTypePopup.cs @@ -44,6 +44,11 @@ namespace MackySoft.SerializeReferenceExtensions.Editor { if (splittedTypePath.Length <= 1) { continue; } + // If they explicitly want sub category, let them do. + if (TypeMenuUtility.GetAttribute(type) != null) { + isSingleNamespace = false; + break; + } for (int k = 0;(splittedTypePath.Length - 1) > k;k++) { string ns = namespaces[k]; if (ns == null) { @@ -54,6 +59,10 @@ namespace MackySoft.SerializeReferenceExtensions.Editor { break; } } + + if (!isSingleNamespace) { + break; + } } // Add type items.