- Home /
Build stripping and scenes in Asset Bundles
I'm working on a mobile game that includes several minigames that we're downloading as Asset Bundled scenes. These minigames use their own gameplay code which does not get compiled with the build when we're also using build stripping. We would like to use build stripping to remove unused internal code while still keeping the minigame code in our compiled build.
We've thought of putting all our own code in a Resources folder or referencing all our own code in a MonoBehaviour somewhere but both of these solutions would require quite a lot of manual work and would also be hard to maintain in the long run. Is there an easier way to force inclusion of code in builds?
As far as I know all your code gets build into your build, except editor scripts.
This is correct when not using build stripping but with build stripping activated all code that is not referenced gets left out. I've managed to test this by duplicating all the scenes and then building with build stripping on. This allows me to run the downloaded scenes but kind of defeats the point of having them downloaded in the first place.
$$anonymous$$aybe you can write an editor script that runs before every build and that references all the code in the scenes that you will build AssetBundles for. That way they will be referenced at build time.
Answer by Diesel · Jun 03, 2013 at 10:27 AM
I ended up putting all my scripts (except Editor scripts) into Resources folders. Writing an Editor script collecting all script dependencies when building the Asset Bundles and referencing them somewhere would probably be a better long term solution though but for a smaller project such as ours the quick Resources folder solutions seems to work fine. It creates some problems with updating plugins though.
Your answer
Follow this Question
Related Questions
how to delete specific files from cache? 3 Answers
Why is there no "Render outside safe area" setting for iOS? 0 Answers
Sending to API special french characters 0 Answers
Huge iOS Build 1 Answer
Best way to handle loading textures based on device? 0 Answers