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); }
public void LuaBehaiourDestory(int id) { LuaUIBase uiBase = m_luaUIs[id]; uiBase.Destroy(); }
public void LuaBehaiourStart(int id) { LuaUIBase uiBase = m_luaUIs[id]; uiBase.Start(); }
public void LuaBehaiourUpdate(int id) { LuaUIBase uiBase = m_luaUIs[id]; uiBase.Update(); }