public static void OnPostprocessAllAssets(string[] importedAsset, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths) { if (Application.isPlaying) { luaFiles.Clear(); for (int i = 0; i < importedAsset.Length; i++) { bool isLuaFile = importedAsset[i].EndsWith(".lua"); if (isLuaFile) { string luaPath = importedAsset[i]; luaPath = luaPath.Substring(assetBundlePath.Length, luaPath.Length - assetBundlePath.Length); luaPath = luaPath.Replace(".lua", ""); luaFiles.Add(luaPath); } } if (luaFiles.Count > 0) { EditorUtility.DisplayProgressBar("HotUpdateLua", "", 0); try { LuaRoot.HotUpdate(luaFiles); Debug.Log("LuaHotUpdate:" + string.Join(",", luaFiles.ToArray())); } catch (Exception e) { Debug.LogException(e); } luaFiles.Clear(); EditorUtility.ClearProgressBar(); } } }
void Start() { /// Log初始化 m_CustomLogHandler = new CustomLogHandler(); /// 网络初始化 NetManager.Instance.Init(); /// Lua初始化 LuaRoot.Init(); }
static int get_Lua(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); LuaRoot obj = (LuaRoot)o; LuaInterface.LuaState ret = obj.Lua; ToLua.PushObject(L, ret); return 1; } catch(Exception e) { return LuaDLL.toluaL_exception(L, e, o, "attempt to index Lua on a nil value"); } }
static int get_LayerList(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); LuaRoot obj = (LuaRoot)o; System.Collections.Generic.List<UnityEngine.GameObject> ret = obj.LayerList; ToLua.PushSealed(L, ret); return 1; } catch(Exception e) { return LuaDLL.toluaL_exception(L, e, o, "attempt to index LayerList on a nil value"); } }
static int get_UIRoot(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); LuaRoot obj = (LuaRoot)o; UnityEngine.GameObject ret = obj.UIRoot; ToLua.PushSealed(L, ret); return 1; } catch(Exception e) { return LuaDLL.toluaL_exception(L, e, o, "attempt to index UIRoot on a nil value"); } }
static int set_LayerList(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); LuaRoot obj = (LuaRoot)o; System.Collections.Generic.List<UnityEngine.GameObject> arg0 = (System.Collections.Generic.List<UnityEngine.GameObject>)ToLua.CheckObject(L, 2, typeof(System.Collections.Generic.List<UnityEngine.GameObject>)); obj.LayerList = arg0; return 0; } catch(Exception e) { return LuaDLL.toluaL_exception(L, e, o, "attempt to index LayerList on a nil value"); } }
static int set_UIRoot(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); LuaRoot obj = (LuaRoot)o; UnityEngine.GameObject arg0 = (UnityEngine.GameObject)ToLua.CheckObject(L, 2, typeof(UnityEngine.GameObject)); obj.UIRoot = arg0; return 0; } catch(Exception e) { return LuaDLL.toluaL_exception(L, e, o, "attempt to index UIRoot on a nil value"); } }
void OnDestroy() { LuaRoot.OnDestroy(); }
void Update() { NetManager.Instance.Update(); LuaRoot.Update(); }
void Awake() { _instance = this; }