Compare commits

..

7 Commits

Author SHA1 Message Date
github-actions[bot] aedc9ba824 feat: Update package.json to 1.1.7 2022-08-30 14:10:03 +00:00
Makihiro ac191b642d Merge pull request #22 from yellowisher/improve/force_nesting
Force nesting when there is any sub menu in AddTypeMenu attribute.
2022-08-30 23:01:10 +09:00
Makihiro a89eb6bb87 Merge pull request #23 from yellowisher/improve/name_as_tie_breaker
Use menu name or type name as tie breaker.
2022-08-26 18:49:29 +09:00
yellowisher 04920fadb7 Use menu name or type name as tie breaker. 2022-08-25 00:00:59 +09:00
yellowisher 1f76157be0 Force nesting when there is any sub menu in AddTypeMenu attribute. 2022-08-25 00:00:26 +09:00
Makihiro 367bf2065c Update README.md 2022-05-05 00:08:44 +09:00
Makihiro d221744fff Update README.md 2022-04-13 22:24:15 +09:00
4 changed files with 24 additions and 4 deletions
@@ -44,6 +44,11 @@ namespace MackySoft.SerializeReferenceExtensions.Editor {
if (splittedTypePath.Length <= 1) { if (splittedTypePath.Length <= 1) {
continue; 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++) { for (int k = 0;(splittedTypePath.Length - 1) > k;k++) {
string ns = namespaces[k]; string ns = namespaces[k];
if (ns == null) { if (ns == null) {
@@ -54,6 +59,10 @@ namespace MackySoft.SerializeReferenceExtensions.Editor {
break; break;
} }
} }
if (!isSingleNamespace) {
break;
}
} }
// Add type items. // Add type items.
@@ -32,6 +32,11 @@ namespace MackySoft.SerializeReferenceExtensions.Editor {
return -999; return -999;
} }
return GetAttribute(type)?.Order ?? 0; return GetAttribute(type)?.Order ?? 0;
}).ThenBy(type => {
if (type == null) {
return null;
}
return GetAttribute(type)?.MenuName ?? type.Name;
}); });
} }
@@ -1,7 +1,7 @@
{ {
"name": "com.mackysoft.serializereference-extensions", "name": "com.mackysoft.serializereference-extensions",
"displayName": "SerializeReference Extensions", "displayName": "SerializeReference Extensions",
"version": "1.1.6", "version": "1.1.7",
"unity": "2019.4", "unity": "2019.4",
"description": "Provide popup to specify the type of the field serialized by the [SerializeReference] attribute in the inspector.", "description": "Provide popup to specify the type of the field serialized by the [SerializeReference] attribute in the inspector.",
"keywords": [ "SerializeReference", "Editor" ], "keywords": [ "SerializeReference", "Editor" ],
+9 -3
View File
@@ -1,8 +1,6 @@
# Unity SerializeReferenceExtensions # Unity SerializeReferenceExtensions
[![Build](https://github.com/mackysoft/Unity-SerializeReferenceExtensions/actions/workflows/build.yaml/badge.svg)](https://github.com/mackysoft/Unity-SerializeReferenceExtensions/actions/workflows/build.yaml) [![Build](https://github.com/mackysoft/Unity-SerializeReferenceExtensions/actions/workflows/build.yaml/badge.svg)](https://github.com/mackysoft/Unity-SerializeReferenceExtensions/actions/workflows/build.yaml) [![Release](https://img.shields.io/github/v/release/mackysoft/Unity-SerializeReferenceExtensions)](https://github.com/mackysoft/Unity-SerializeReferenceExtensions/releases) [![openupm](https://img.shields.io/npm/v/com.mackysoft.serializereference-extensions?label=openupm&registry_uri=https://package.openupm.com)](https://openupm.com/packages/com.mackysoft.serializereference-extensions/)
[![Release](https://img.shields.io/github/v/release/mackysoft/Unity-SerializeReferenceExtensions)](https://github.com/mackysoft/Unity-SerializeReferenceExtensions/releases)
[![openupm](https://img.shields.io/npm/v/com.mackysoft.serializereference-extensions?label=openupm&registry_uri=https://package.openupm.com)](https://openupm.com/packages/com.mackysoft.serializereference-extensions/)
**Inspired by [this post](https://qiita.com/tsukimi_neko/items/7922b2433ed4d8616cce).** **Inspired by [this post](https://qiita.com/tsukimi_neko/items/7922b2433ed4d8616cce).**
@@ -146,3 +144,11 @@ Also, [this thread](https://forum.unity.com/threads/serializereference-data-loss
#### References #### References
- https://forum.unity.com/threads/serializereference-data-loss-when-class-name-is-changed.736874/ - https://forum.unity.com/threads/serializereference-data-loss-when-class-name-is-changed.736874/
- https://issuetracker.unity3d.com/issues/serializereference-serialized-reference-data-lost-when-the-class-name-is-refactored - https://issuetracker.unity3d.com/issues/serializereference-serialized-reference-data-lost-when-the-class-name-is-refactored
# <a id="help-and-contribute" href="#help-and-contribute"> ✉ Help & Contribute </a>
I welcome feature requests and bug reports in [issues](https://github.com/mackysoft/XPool/issues) and [pull requests](https://github.com/mackysoft/XPool/pulls).
If you feel that my works are worthwhile, I would greatly appreciate it if you could sponsor me.
GitHub Sponsors: https://github.com/sponsors/mackysoft