vasyab / UnityPickers

Value selection controls for Unity game engine editor.
MIT License
33 stars 3 forks source link

Allow filtering by Monobehaviour Subtypes #1

Open mjholtzem opened 6 years ago

mjholtzem commented 6 years ago

Not sure if this is possible with Unity's APIs, but it would be awesome if you could filter a prefab search by a monobehaviour subtype

vasyab commented 6 years ago

Unfortunately, you would have to load and check every prefab in the project to do this. Unity search API doesn't allow such filters.

It is possible to implement such feature by preprocessing all prefabs at startup and collecting types information. That would cause long warmup time though.

vasyab commented 6 years ago

We are using [AssetPathFilter("Part/Of/Prefabs/Path")] attribute on fields as a workaround for this ;)

mjholtzem commented 6 years ago

yeah fair enough. I implemented it myself and it is quite slow when you have a lot of assets. Still is pretty useful though (at least to me) and could maybe be implemented as an optional "on demand" feature.