private void OnSystemMessage(string message) { if (m_Tb != null) { m_Tb.CallFunc(SYS_MESSAGE, 0, message); } }
public object CallLuaFunction(string function, params object[] args) { if (!LuaModule.CacheMode) { Reload(); } if (_cacheTable == null) { throw new Exception(string.Format("{0}: cannot get table!", LuaPath)); } //Fix:在Lua的不同方法中调用self为nil return(_cacheTable.CallFunc(function, args)); // var retFunc = _cacheTable[function]; // if (retFunc != null) // { // if (!(retFunc is LuaFunction)) // { // throw new Exception(string.Format("{0}: {1} must be function!", LuaPath, function)); // } // // var func = retFunc as LuaFunction; // // return func.Call(args); // } // // return null; }
private void Start() { var L = LuaScriptMgr.Instance.L; int n = L.DoFile(luaScript); Assert.IsTrue(n == 1); m_Tb = L.ToLuaTable(-1); L.Pop(1); Assert.IsNotNull(m_Tb); m_Tb.CallFunc(onInit, 0, this); }
protected override void Awaking() { Debug.Log("Starting Instance SDKMgrs Form Lua Files ___>> framwork/main.lua"); int n = L.DoFile(SCRIPT_FILE); Assert.IsTrue(n == 1); m_Tb = L.ToLuaTable(-1); L.Pop(1); Assert.IsNotNull(m_Tb); m_Tb.CallFunc("awake", 0); }
protected override void Awaking() { if (!string.IsNullOrEmpty(m_luaScript)) { var L = LuaScriptMgr.Instance.L; int n = L.DoFile(m_luaScript); Assert.IsTrue(n == 1); m_Tb = L.ToLuaTable(-1); L.Pop(1); Assert.IsNotNull(m_Tb); m_Tb.CallFunc(APP_LAUNCH, 0); } #if UNITY_EDITOR #elif UNITY_IOS SDKManager.OnGameLaunch(); #endif }
private void OnHttpResponse(string tag, string resp, bool isDone, string error) { m_Tb.CallFunc(onHttpRes, 0, tag, resp, isDone, error); }
private void OnUIClick(GameObject go) { m_Tb.CallFunc("on_ui_click", 0, go); }
void Start() { m_Tb.CallFunc(START, 0); }