Example #1
0
 private void initLuaFunc()
 {
     object[] _v = LuaEvnBase.GetInstance().luaEnv.DoString(Utility.LoadLuaFile(FilePath), this.name);
     m_luaTab = _v[0] as LuaTable;
     m_luaTab.Set("gameObject", this.gameObject);
     m_luaTab.Get("start", out m_luaStart);
     m_luaTab.Get("update", out m_luaUpdate);
     m_luaTab.Get("onDestroy", out m_luaOnDestroy);
 }
Example #2
0
        private void Start()
        {
            if (m_luaStart != null)
            {
#if UNITY_EDITOR
                LuaEvnBase.GetInstance().luaEnv.DoString(@"
                    local _proFiler = require 'perf.profiler'
                    _proFiler.start()");
                m_luaStart(m_luaTab);
                LuaEvnBase.GetInstance().luaEnv.DoString(@"
                    local _proFiler = require 'perf.profiler'
                    print(_proFiler.report())
                    _proFiler.stop()");
#else
                m_luaStart(m_luaTab);
#endif
            }
        }