Custom types from ScriptedImporter can't be found in AssetDatabase?

Let’s say I have written a ScriptedImporter that declares itself for a file type of “.foo”:

[ScriptedImporter(1, "foo")]

I can’t find a way to later find those through the normal methods for finding assets as exposed from AssetDatabase, such as AssetDatabase.FindAssets.

I have tried:

AssetDatabase.FindAssets("t:foo");
AssetDatabase.FindAssets("foo");

Neither will return anything these custom assets, though the latter will return default assets that have “foo” in the name.

The “t:” construct refers to the actual object Type.

You are looking for just the extension to be “.foo”

I recommend spinning all the assets via the asset database and asking if their filename ends with “.foo”

That is sort of what I was aiming for with the second option. I didn’t actually expect the type option to work, I just gave it a shot :slight_smile: But I did expect the search to match the extension.

I guess I have to grab a list of ALL assets and sort through them? That doesn’t sound very performant, but I’ll give it a shot.

You can also do it once and then subscribe to asset addition/removal events and keep your own list up to date… not sure I would bother honestly, but you might enjoy that sort of coding more than I do!