Asset creator in Unity

Hi All, I'm trying to create an app which will enable users to create assets on the fly. To do this, I need to provide the user with some default assets which come packaged with the app, but then also allow them to create and save out new ones which are loaded at run time.

In order to load resources at run-time, it seems that I need to be using AssetBundles, but from what I can tell, the ability to create new AssetBundles is part of UnityEditor and not UnityEngine, and as such cannot be done without making a call to the Unity.exe -batch mode.

The other code I found that deals with creating assets is to call AssetDatabase.SaveAssets, but that seems to be an editor call as well.

Is there a way to do what I'm trying to do? Can I just load new resources off the file system once I'm compiled?

Thanks, Liron

You can't save assets from Unity in the way you want. As you've discovered, these are editor functions, not engine functions.

What you could do instead is find a way to save assets in a form for which you can write a loader. For example, if you have a .jpg image you can load it into a Texture2D. For 3D models, you could write out the vertices, edges, etc. and then construct a Mesh on the fly from the this data.

The way we ended up solving this is by having a default mesh which we imported into unity and then writing out the deltas for each vertex as a text file. We then load in the text file, read the deltas and apply them to each vertex.