Пример #1
0
        public int InitLuaBehaviour(MonoBehaviour behaviour)
        {
            LuaUIBase uiBase           = m_luaUIPool.Get();
            int       luaIndex         = m_curLuaUIIndex;
            int       unUsedIndexCount = m_unUsedLuaUIIndexs.size;

            if (unUsedIndexCount > 0)
            {
                luaIndex           = m_unUsedLuaUIIndexs.Pop();
                m_luaUIs[luaIndex] = uiBase;
            }
            else
            {
                m_luaUIs.Add(uiBase);
                m_curLuaUIIndex++;
            }
            LuaBehaviour luaScrpit      = (LuaBehaviour)behaviour;
            LuaTable     scriptEnvTable = CreateNewTableWithLuaFile(luaScrpit.luaFileName);

            uiBase.Init(luaIndex, scriptEnvTable, luaScrpit);
            return(luaIndex);
        }
Пример #2
0
        public void LuaBehaiourDestory(int id)
        {
            LuaUIBase uiBase = m_luaUIs[id];

            uiBase.Destroy();
        }
Пример #3
0
        public void LuaBehaiourStart(int id)
        {
            LuaUIBase uiBase = m_luaUIs[id];

            uiBase.Start();
        }
Пример #4
0
        public void LuaBehaiourUpdate(int id)
        {
            LuaUIBase uiBase = m_luaUIs[id];

            uiBase.Update();
        }