Is it possible to reference a custom file type in the inspector?

Hi guys,

For context, I’m working on a strange project right now where all of the 3D models, bone layouts and animations are in formats not native to Unity. I’ve written custom asset importers for all of the file types, but now I’d like to link them up in a way that creates an easy workflow.

How can I reference a file that is NOT a UnityEngine.Object or .asset file in a script? For example, is it possible in code to have an inspector field that is looking for file types of .png, .jpg, .xx, .random, ect? If not, are there any workarounds?

Thanks in advance!

AFAIK. No. However, unity takes files “as is”, if they end with .bytes, and then you can read it with TextAsset.bytes

So, it might be a bit annoying, but you could do it so files add an extra extension so it ends in bytes. For example, say you had myfile.random, you could make it so it’s myfile.random.bytes, and then work from there. It’s bothersome, but it’s the only workaround I can think of.

@TylerMorton
I think that he means to USE the custom file type. Just as an example, I have a crap ton of KMP files. They contain points and identification for each point. I would want the inspector to be able to display and edit the points and their IDs. Each ID referencing a model or effect area.