C#打印Lua table

//加了個打印luatable的方法  使用方式LuaState.DumpTable(cfg);
public static void DumpTable(LuaTable lua_tab)
{
   object[] objs = lua_tab.ToArray();

   if (objs.Length > 0)
   {
       for (int i = 0; i < objs.Length; i++)
       {
           LuaTable cfg = (LuaTable)objs[i];
           DumpTable(cfg);
       }

   }else
   {
        LuaDictTable dict = lua_tab.ToDictTable();
        lua_tab.Dispose();
        var iter2 = dict.GetEnumerator();
        while (iter2.MoveNext())
        {
            Debugger.Log("map item, k,v is {0}:{1}", iter2.Current.Key, iter2.Current.Value);
        }
   }
}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章