- Home /
How to Find Assets of the Same Type in Editor Script
Hi There
I would like to be able to find assets of a particular type if possible so that in my EditorWindow I can present a dropdown of the available assets the user could choose. Is it possible to do something like:
MyScriptableObject[] assets = AssetDatabse.FindAssets<MyScriptableObject>();
Or do I need to use something like an ObjectField here?
Thanks Bovine
Comment
Best Answer
Answer by Bovine · Mar 04, 2014 at 12:57 PM
I believe I can do this using FindObjectsOfTypeAll(), even in the Editor, though determining what is a prefab and what is not might prove tricky, but I guess items could be identified with a script that tags them as EditorAssets say, and this script would be delete itself in Awake().