• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This post has been wikified, any user with enough reputation can edit it.
avatar image
0
Question by Diesel · May 30, 2013 at 09:58 AM · androidiosbuildwwwasset bundles

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?

Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image $$anonymous$$ · May 30, 2013 at 10:53 AM 0
Share

As far as I know all your code gets build into your build, except editor scripts.

avatar image Diesel · May 30, 2013 at 11:10 AM 0
Share

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.

avatar image $$anonymous$$ · May 30, 2013 at 12:04 PM 0
Share

$$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.

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

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.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

13 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Huge iOS Build 1 Answer

Why is there no "Render outside safe area" setting for iOS? 0 Answers

Accept self-signed certificate using WWW 0 Answers

Am i able to export to android with 30 day pro ? 3 Answers

WWW Post (Form) not working on mobile. 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges