Unity3d's Assetbundle Learning: running Notes on Android

Source: Internet
Author: User

Path unification

Loading the Assetbundle file under the Streamingassets folder on Android requires processing the load address first, noting that the address inconsistencies of the PC, Android, and iOS need to be handled differently for different platforms, and the common code is as follows:

1     //unify streamingassets paths under different platforms2      Public Static ReadOnly stringStreaming_assets_path =3 #ifUnity_android4     "jar:file:///"+ Application.datapath +"!/assets/";5 #elifUnity_iphone6Application.datapath +"/raw/";7 #elifUnity_standalone_win | | Unity_editor8     "file:///"+ Application.datapath +"/streamingassets/";9 #elseTen     string. Empty; One #endif

Load-time paths are added directly to the following:

New "xxx . Assetbundle ");
about the script supplement

Scripts in unity seem to be not packaged in the editor folder, and scripts in other folders are packaged, so the script in Assetbundle is just a reference, but as long as there is a script with the same name in the program.

Places to be aware of

Be sure to repackage all Assetbundle as Android versions before you pack the game, or publish to a real-time issue that cannot be loaded.

Unity3d's Assetbundle Learning: running Notes on Android

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.