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