Beispiel #1
0
 private void OnSystemMessage(string message)
 {
     if (m_Tb != null)
     {
         m_Tb.CallFunc(SYS_MESSAGE, 0, message);
     }
 }
Beispiel #2
0
        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;
        }
Beispiel #3
0
        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);
        }
Beispiel #4
0
        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);
        }
Beispiel #5
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
        }
Beispiel #6
0
 private void OnHttpResponse(string tag, string resp, bool isDone, string error)
 {
     m_Tb.CallFunc(onHttpRes, 0, tag, resp, isDone, error);
 }
Beispiel #7
0
 private void OnUIClick(GameObject go)
 {
     m_Tb.CallFunc("on_ui_click", 0, go);
 }
Beispiel #8
0
 void Start()
 {
     m_Tb.CallFunc(START, 0);
 }