Object Picker for fields of type MonoBehaviours with AssetsOnly-Attribute

Issue #231 closed
Anonymous created an issue

I have noticed that the "Select Object"-Window in combination with the AssetsOnly attribute only works with fields of type GameObject and not MonoBehaviour scripts. Is that by design?

The following works fine:

[AssetsOnly]
public GameObject test;

While this does not:

[AssetsOnly]
public SomeMonoBehaviour test;

I can drag&drop the prefab onto the property, but I can not pick the prefab via the select window. The window is empty and only offers "None".

Unity: 2017.2.0f3
OS: Windows 10

Comments (1)

  1. Bjarke Elias Clauson-Kaas ├śrrild

    This is unfortunately not something we can easily do anything about.

    We're using unity's internal object-picker and it doesn't support looking for Behaviour types in prefabs etc.

    It's on our roadmap to replace Unity's object-picker wit a stronger version, that can also handle polymorphic type instantiation and recursive generic constraints and constructor resolution, as well as custom sources of assignable things. But something this strong should also be more than just a drop-down, it should have previews, support multi-selection and you should be able to draw it anywhere etc...

    It's something we really want to do, but it's a big feature and we don't currently know when we'll have the time to make it.

  2. Log in to comment