public LuaTable GetTable(string fullPath, bool beLogMiss = true) { WeakReference weak = null; if (funcMap.TryGetValue(fullPath, out weak)) { if (weak.IsAlive) { LuaTable table = weak.Target as LuaTable; if (table.IsAlive) { table.AddRef(); RemoveFromGCList(table.GetReference()); return(table); } } funcMap.Remove(fullPath); } if (PushLuaTable(fullPath, false)) { int reference = ToLuaRef(); LuaTable table = null; if (funcRefMap.TryGetValue(reference, out weak)) { if (weak.IsAlive) { table = weak.Target as LuaTable; if (table.IsAlive) { funcMap.Add(fullPath, weak); table.AddRef(); RemoveFromGCList(reference); return(table); } } funcRefMap.Remove(reference); } table = new LuaTable(reference, this); table.name = fullPath; funcMap.Add(fullPath, new WeakReference(table)); funcRefMap.Add(reference, new WeakReference(table)); if (LogGC) { Debugger.Log("Alloc LuaTable name {0}, id {1}", fullPath, reference); } RemoveFromGCList(reference); return(table); } if (beLogMiss) { Debugger.LogWarning("Lua table {0} not exists", fullPath); } return(null); }