Hello all.
Our current game production is nearing the dreaded 100mb limit on iOS.
We are currently implementing an asset bundle system to download additional content post-install (android/iOS).
This has raised a lot of workflow issues where we are getting to the point of asking: “Really, its like this?”.
The new way of tagging assets for bundle inclusion is nice, no doubt about it.
We are having issues figuring the best way to handle packing models/textures/animations into assetbundles while maintaining a proper workflow for further production post-launch.
Unfortunately we can’t just tag every prefab we have to be included in a bundle, because there a lots of scripts attached to these prefabs, and we cannot put scripts in assetbundles.
An example of our prefab structure could be:
-Parent GameObject
-ModelController object
-submesh
-submesh
-ColliderController object
-AudioController object
etc…
Each gameobject and mesh object below the parent can have various scripts attached to them (to handle VFX etc.)
So our solution to this problem is to assign null meshes / null animatorControllers to everything, and then put those meshes / animator controllers in assetbundles so that they are excluded from the build at buildtime. Same goes for textures.
This saves us a lot of precious megabytes in the final build. Post-launch we will be adding more and more models/animations/sounds etc, so we are hoping to have this system save us from the appsize growing too much.
Now comes the main issue:
Our prefabs are now unworkable at edit-time, since all their meshes are gone (they arent loaded until runtime).
My solution to this was to try and make a script that fires when a build is started, which looks for meshes and models that are tagged in assetbundles, and then go through every meshrenderer and null out the mesh, so it isnt included in the build. But now the prefabs are again unworkable because theres no way to revert the change right AFTER a build is done.
And this was the point where I decided to look for other peoples experiences. Surely there has to be a better way of going about this?
EDIT: Darn it, I think this post should have been in “General Support” instead. If this is the case, could a moderator please move it for me? thanks