Add Asset Reference Resolving by labels. Add including only ignored tags/labels. Update AssetRefResolver custom editor. #3
+51
−9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently AssetReferenceResolver use "Ignore by GO tag" logic. It works fine for prefab assets, but there are thousands of non-GO assets, which may need to be ignored. Unity has powerful feature for filtering assets - labels, which can be assigned in the bottom section of asset inspector. So i added
ignoredLabels
string[] field and implemented filtering logic.Also, in some cases user may want to include only assets with certain tag/label, instead of ignoring those labels/tags. For this case i added 2 fields
includeIgnoredTags/Labels
I tested it for my project, works fine. Of course there will be extra CPU/Memory extra utilization (about 15%), but only when user adds any values to
ignoredLabels
. IncludeIgnored works via simple XOR and boolean ops.I'm also suggesting to remove "Tags" logic for reference resolving, and maybe add labels to PrefabReferenceResolver, because labels are the perfect way for asset filtering during EditorTime (where reference resolving is actually happening), also, unlike tags, we can apply any amount of labels to the asset/prefab. But this suggestions are completely under your command, just let me know if you accept it.