do you know if a plugin to serialize a Unity scene in to XML already exists? This plugin should transform every gameobject into prefab and assetbundle them.
A loading mechanism would be able to recreate the scene from the Unity file and the asset bundles.
Well the system must load some resource to be able to recreate the objects. We do not want to bundle the resource into the client, so it must generate and handle assetbundles as well. Can you see what I mean?
you have to decide if you want to use prefab and asset bundle or xml.
Thats not the same thing, not even remotely. The path to go, the effort and the licenses involved differ heavily.
Prefab + asset bundles is trivial compared to xml as all it needs is some editor extension scripts + pro license for the target platforms
there is something I am missing here. Is your idea to serialize everything in a xml file including meshes and textures? My idea was to serialize only the gameobject data and load dynamically the rest through asset bundles
Not the textures, you just save a reference to a texture and then apply it again to a material. Serializing textures takes alot of diskspace I think. You can also load them using the www class and apply them at runtime. Just Meshes and submeshes and the data to recreate the materials. Thats about it I think.
surely it does, that’s why I need the textures and meshes assetbundles. Probably I would assetbundle the entire prefab, but ok, these are implementation details. I just wanted to know if there was something similar ready to use.
If you want have something similar to being able to import a scene with all required ressources linked into an asset bundle; all you need is a Pro license and export the scene into a streamable assetbundle. It’s even compressed for you and contains the lightmaps. However, it will not include ressources that are not present in the scene.
That you have to manually add into the assetbundle.
thanks, we already use the pro version, however unless we use the push/pop dependencies logic it is not possible to extract the static assets from the levels. I am thinking about finding an alternative, that’s what this post is all about.
p.S.: we cannot afford to have an entire scene as assetbundle, we need the single props to be assetbundled, because they are shared among the levels.
Because you want an external ressource library, you should definitely go into manually creating the AssetBundle (push / pop as you say) instead of rolling a whole serialization / deserialization solution for every possible asset type into an XML.
If you really want to go low-level, you could even potentionally create the scenes themselves by code using the text-based YAML format and link assets through it. (havn’t tried, so don’t take my word for it)