Unity releases Android LUA path no problem

Source: Internet
Author: User
Tags lua

The project is Xlua with a custom load method

Using file to read the files under the path, the Lua file is placed under the Streamingassets path

PC run no problem, after publishing Android, actually prompted the path does not exist.

After checking the information, I found that this mode of operation of the file can not be read on the Android platform streamingassets path files, heck

This path can only be used for assetbundle.loadfromfile operation.

Information reference: http://www.xuanyusong.com/archives/4033

If you really want to read it this way, then don't put the file under the Streamingassets path.

Only LUA can be placed in the Application.persistentdatapath; This path, I still manually copied to Android, it can be done on Android can see this file

(I found this path on the emulator, on the Xiaomi phone did not find this path =)

This can make a custom script game on the phone, it feels good.

Later, the solution is to add lua to the TXT suffix, and then the AB package is placed under the Streamingassets path, you can use the Assetbundle.loadfromfile to operate the

Code

1 void Requirelua (string  name) {2   typeof as textasset; 3   Lua. Dostring (luacode.text); 4 }

Feel good, than my convenience, before the big Olympics that LUA framework, is not very easy to use, the key is not understand his kind of writing, then I can learn from the code above the wording

" Other references "

Unity in the mobile platform, file operation path Detailed: http://blog.csdn.net/huang9012/article/details/44308743

path in Unity corresponds to the path in each platform : Http://www.manew.com/forum.php?mod=viewthread&tid=21404&extra=page%3D1%26filter%3Dtypeid%26typeid %3d143

What are the blogs of good programmers? : https://www.zhihu.com/question/19934502

"Possible re-optimization" retain the. Lua suffix name, package lua files into Assetbundle: http://blog.csdn.net/musicseli/article/details/46415075

"Detect updates, AB encryption"Unity Hand Tour < 12 > The discussion on the hot-update strategy of Hand Tour resources: http://blog.csdn.net/janeky/article/details/17666409

"Unity resource processing mechanism (assets/www/assetbundle/... Read and load resources in a detailed manner ": http://blog.csdn.net/swj524152416/article/details/54022282

Unity releases Android LUA path no problem

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.