Skip to content

Commit ac191b6

Browse files
authored
Merge pull request #22 from yellowisher/improve/force_nesting
Force nesting when there is any sub menu in AddTypeMenu attribute.
2 parents a89eb6b + 1f76157 commit ac191b6

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Editor/AdvancedTypePopup.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ public static void AddTo (AdvancedDropdownItem root,IEnumerable<Type> types) {
4444
if (splittedTypePath.Length <= 1) {
4545
continue;
4646
}
47+
// If they explicitly want sub category, let them do.
48+
if (TypeMenuUtility.GetAttribute(type) != null) {
49+
isSingleNamespace = false;
50+
break;
51+
}
4752
for (int k = 0;(splittedTypePath.Length - 1) > k;k++) {
4853
string ns = namespaces[k];
4954
if (ns == null) {
@@ -54,6 +59,10 @@ public static void AddTo (AdvancedDropdownItem root,IEnumerable<Type> types) {
5459
break;
5560
}
5661
}
62+
63+
if (!isSingleNamespace) {
64+
break;
65+
}
5766
}
5867

5968
// Add type items.

0 commit comments

Comments
 (0)