1 AppConst:
DebugMode: 调试模式,true:lua脚本直接读取自AssetDir,false:开始会将AssetDir内的lua脚本复制到Util.DataPath内(根据平台不同此文件夹不同,如果是editor模式,则为游戏根目录的AppConst.AppName.ToLower()文件夹,移动平台为persistentDataPath)
UpdateMode: 是否启动远程更新,更新地址为AppConst.WebUrl,将地址下的file.txt文件和本地persistentDataPath中的同名文件做比对,内容为以 “|”分隔的fileName和md5值拼接的字符串 行,每行为一条资源数据
LuaByteMode:是否将lua以字节码形式保存
LuaBundleMode:是否将lua脚本以文件夹为单位打包为assetsBundle
ExampleMode:是否将范例资源文件打包
2 加载第三方lua库
加载第三方库
LuaFramework ->Scripts->Manager->LuaManager.cs
void OpenLibs() {
lua.OpenLibs(LuaDLL.luaopen_sproto_core);
lua.OpenLibs(LuaDLL.luaopen_protobuf_c);
this.OpenCJson();
}
在luaDLL中
[DllImport(LUADLL, CallingConvention = CallingConvention.Cdecl)]
public static extern int luaopen_sproto_core(IntPtr L);
[DllImport(LUADLL, CallingConvention = CallingConvention.Cdecl)]
public static extern int luaopen_protobuf_c(IntPtr L);
Original: https://www.cnblogs.com/pengyingh/p/7161532.html
Author: pengyingh
Title: unity luaFramework
原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/546787/
转载文章受原作者版权保护。转载请注明原作者出处!