/// <summary> /// 取消加载 /// </summary> public void CancelLoad() { StopAllCoroutines(); if (_luaEnv != null) { _luaEnv.Dispose(); _luaEnv = null; } if (_loader != null) { _loader.UnInit(); _loader = null; } LuaFramework = null; _updateFunc = null; }
/// <summary> /// 初始化Lua framework层 /// </summary> /// <param name="init">true:初始化;false:反初始化</param> public void InitFramework(bool init = true) { if (init == _initFramework) { JW.Common.Log.LogE("LuaService.InitFramework : duplicate init/uninit - {0}", init); return; } if (_luaEnv == null) { JW.Common.Log.LogE("LuaService.InitFramework : lua service not initialize"); return; } _initFramework = init; LuaFunction initFramework = _luaEnv.Global.Get <LuaFunction>("InitFramework"); if (initFramework != null) { initFramework.Action <bool>(init); } if (init) { LuaFramework = new LuaFramework(); LuaFramework.Initialize(_luaEnv); } else { if (LuaFramework != null) { LuaFramework.UnInitialize(); LuaFramework = null; } } initFramework = null; }