codewriter-packages / Tri-Inspector

Free inspector attributes for Unity [Custom Editor, Custom Inspector, Inspector Attributes, Attribute Extensions]
MIT License
972 stars 47 forks source link

Implement Editor for AssetImporter and ScriptedImported #112

Closed xarpen closed 1 year ago

xarpen commented 1 year ago

Hi, this add support for AssetImporterEditor and ScriptedImporterEditor. I've just botch copied your code for now, if you have a better idea I'm happy to split the code to some static class or something.

vanifatovvlad commented 1 year ago

Hi @xarpen , thanks for contribution! Can you describe why you omitted the isFallback property and AllowEditorMultipleObjects attribute that are present for regular editors? Can you also provide here small examples of how to use these new editors?

xarpen commented 1 year ago

Hi, I've reverted the AllowEditorMultipleObjects, it was removed by mistake when I was trying to understand why it would not show. It seems for whatever reason (and I didn't not look thoroughly) that when you have isFallback=true it picks some other inspector for default, and does not show nicely.

I've created a "native" importer for Vox format which I plan to publish to Github soon. I use your plugin to improve Inspector visibility of the ScriptedImporter.

Second importer I think is for when you want to override default AssetImporter to do some custom pre-post importing logic (like change the texture max size by the content). I don't really use it right now, and I can remove it from PR if you think there would be no use for it in future.

image