- Home /
Answer by DiegoSLTS · May 28, 2016 at 03:01 PM
Well, the other day I had the same question and found 2 things:
You can write your own custom asset importer: http://www.sarpersoher.com/a-custom-asset-importer-for-unity/
You can add your own "userData": http://docs.unity3d.com/ScriptReference/AssetImporter-userData.html
I've not tested any of that, but I guess that's the way you add your own info to metadata files.
Thank you for the reply.
I've some trouble getting it to work though. I've created a class extending AssetPostprocessor and changed the userData of the .meta file here. That worked, but I have 2 problems :
I can't find how to create a custom editor letting me change the userData in the inspector.
I can't find how I can access the userData of my asset from scripts.
Do you have any idea ?
Thanks again!
Quick update : I found that I can get the metadata of an asset this way :
AudioImporter importer = (AudioImporter)AssetImporter.GetAtPath(AssetDatabase.GetAssetPath(my$$anonymous$$usic));
string data = importer.userData;
I've still some trouble extending AudioImporter's inspector.
Found this: http://answers.unity3d.com/questions/261446/custom-inspector-when-selecting-from-project-tree.html
But it works only with ".asset" assets... $$anonymous$$aybe you can rename your files with assetimporter?
I ended up following using EditorWindow, as advised here : http://answers.unity3d.com/questions/55722/custom-inspector-element-on-texture-importer.html
I also tried that : http://forum.unity3d.com/threads/custom-textureimporterinspector.260833/
But despite the fact that the inspector displayed correctly the original AudioImporterInspector, the checkboxes were unresponsive, so I gave up.
Thanks anyway, I appreciate the help :)
Your answer
Follow this Question
Related Questions
Unity Pro re-imports everything on launch 1 Answer
How do I load the assets from a tutorial? 2 Answers
Custom Fonts... Missing on friend's computer 1 Answer
Material tiling on imported fbx model doesn`t fit 0 Answers
how to make assets and textures from quixel bridge look like in 3d preview from bridge 1 Answer