| | |
| | | [LuaCallCSharp] |
| | | public class LuaWindow : Window |
| | | { |
| | | |
| | | public string filePath = ""; |
| | | |
| | | Action luaOnDestroy; |
| | | |
| | | Action onBindController; |
| | |
| | | table.SetMetaTable(meta); |
| | | meta.Dispose(); |
| | | |
| | | LuaUtility.Do(string.Format("window.{0}", this.gameObject.name), this.gameObject.name, table); |
| | | LuaUtility.Do(filePath, this.gameObject.name, table); |
| | | |
| | | table.Get("BindController", out onBindController); |
| | | table.Get("AddListeners", out onAddListeners); |
| | |
| | | } |
| | | } |
| | | |
| | | #if UNITY_EDITOR |
| | | [ContextMenu("LuaReload")] |
| | | public void ReLoadLua() |
| | | { |
| | | LuaUtility.Do(string.Format("window.{0}", this.gameObject.name), this.gameObject.name, table); |
| | | |
| | | if (onBindController != null) |
| | | { |
| | | onBindController(); |
| | | } |
| | | |
| | | if (onAddListeners != null) |
| | | { |
| | | onAddListeners(); |
| | | } |
| | | } |
| | | #endif |
| | | } |