Unity3d APK package and access method

Source: Internet
Author: User

Unity3d development of 3D games inevitably requires a large amount of models, images and other resources. It only takes a few megabytes to eat a game APK package, but the resources are dozens of megabytes, hundreds of megabytes, or even hundreds of megabytes. You can publish the APK separately, and then copy the resource package to the SD card separately for file access. However, this operation is troublesome. If this method is used to publish a game, the audience may not be able to accept it. Another way is to package the resource package into the APK package. In this way, you only need to install one APK package, but the problem is that the APK package is large.

So how to package the resource package into the APK package? In fact, it is very easy to create a new streamingassets folder in the project folder and put the various resource files to be packaged under this directory. In this way, resources are packaged into the assets folder in the APK package. What directory is used to access the resources here? It is actually quite simple. "jar: file: //" + application. datapath + "! /Assets is the path to access this directory. If it is iOS platform, the path is application. datapath + "/raw". The file path must be case-sensitive. The file path is case-sensitive. If you do not pay attention to this issue, you may not be able to load resources. Therefore, the project naming rules should be well established at the beginning.

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.