-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Open
Description
public override void Initialize(GameObject eventSystem)
{
base.Initialize(eventSystem);
luaEnv = new LuaEnv();
LuaEnv.CustomLoader loader = CustomLoader;
luaEnv.customLoaders.Clear();
luaEnv.AddLoader(loader);
luaEnv.AddBuildin("pb", XLua.LuaDLL.Lua.LoadLuaProfobuf);
luaEnv.AddBuildin("rapidjson", XLua.LuaDLL.Lua.LoadRapidJson);
}
private byte[] CustomLoader(ref string filepath)
{
TextAsset asset = App.Loader.LoadAsset<TextAsset>(PATH + filepath + ".lua.txt");
return asset.bytes;
}
目前是先把所有的lua文件异步加载到内存中,CustomLoader从内存中获取, 有更好的方案支持CustomLoader直接使用async/await异步加载吗?或者是必须得修改xlua的源代码支持异步require呢?
Metadata
Metadata
Assignees
Labels
No labels