Lua_ Lua结合BundleManager实现网络热更新_023
2017-09-09 10:52
375 查看
创建简单脚本
创建 lua_bundle_test.txt内容很简单:
print(‘从服务器加载,并执行成功啦’);
使用BundleManager制作Bundle
制作Bundle配置Bundle
之后Build
将该目录剪切到其他目录比如G:\
HttpFileServer
将剪切的目录拖放到右侧加载Lua代码并执行
using UnityEngine; using System.Collections; using LuaInterface; public class Test1 : MonoBehaviour { // Use this for initialization IEnumerator Start () { DownloadManager.SetManualUrl("http://192.168.10.112:8080/StreamingAssets/Standalones/"); yield return StartCoroutine(DownloadManager.Instance.WaitDownload("lua_bundle.assetBundle")); WWW www = DownloadManager.Instance.GetWWW("lua_bundle.assetBundle"); var bundle = www.assetBundle; string[] assNames = bundle.GetAllAssetNames(); foreach(string s in assNames) { Debug.Log(s); } Object[] asss = bundle.LoadAllAssets(); foreach(object obj in asss) { Debug.Log(obj.GetType()); } TextAsset text = bundle.LoadAsset("lua_bundle_test") as TextAsset; LuaState l = new LuaState(); l.DoString(text.text); } // Update is called once per frame void Update () { } }
加载情况
相关文章推荐
- Lua_ Lua结合BundleManager实现网络热更新_023
- C++结合LUA实现代码热更新
- samba结合AD实现大型网络方案 推荐
- Ueditor结合七牛云存储上传图片、附件和图片在线管理的实现和最新更新
- Unity5.x ScriptableObject数据存储结合AssetBundle打包实现数据资源热更新
- Hybrid模式-利用AssetsManager实现在线更新脚本文件lua、js、图片等资源(免去平台审核周期)
- python 结合 schedule 和thread 实现触发式周期调用某函数(更新数据)
- Lua5.1.4代码分析 如何实现Lua代码的热更新
- EF结合SqlBulkCopy实现高效的批量数据插入 |EF插件EntityFramework.Extended实现批量更新和删除
- Cocos2d-x使用Luajit将Lua脚本编译为bytecode,实现加密 更新
- 基于nginx + lua实现的反向代理动态更新
- 【COCOS2DX-LUA 脚本开发之十二】Hybrid模式-利用AssetsManager实现在线更新脚本文件lua、js、图片等资源(免去平台审核周期)
- 【COCOS2DX-LUA 脚本开发之十二】Hybrid模式-利用AssetsManager实现在线更新脚本文件lua、js、图片等资源(免去平台审核周期)
- tensorflow中optimizer如何实现神经网络的权重,偏移等系数的更新和梯度计算
- 【COCOS2DX-LUA 脚本开发之八】不用CCHttpClient而转用quick-cocos2d-x或cocos2dx-LuaProxy的Lua框架实现Lua-Http网络交互!
- Midapex网络开发库v2.2(更新主题:使用C#实现的FTP客户端)
- STP HSRP LSA TRACK SLA和NAT结合实现网络出口的冗余
- Android 使用ViewPager结合PhotoView开源组件实现网络图片在线浏览功能
- EF结合SqlBulkCopy实现高效的批量数据插入 |EF插件EntityFramework.Extended实现批量更新和删除
- Android 使用ViewPager结合PhotoView开源组件实现网络图片在线浏览功能