public void Request(string route, LuaInterface.LuaTable paramsTable, LuaInterface.LuaFunction func) { if (pc != null) { JsonObject msg = new JsonObject(); IEnumerator <DictionaryEntry> paramList = paramsTable.ToDictTable().GetEnumerator(); while (paramList.MoveNext()) { DictionaryEntry curr = paramList.Current; Debug.Log("key " + curr.Key + " value: " + curr.Value); msg[curr.Key.ToString()] = curr.Value; } pc.request(route, msg, (result) => { PomeloPackage pkg = new PomeloPackage(); if (func == null) { Debug.LogError("callback function is null!"); } pkg.luaFunc = func; pkg.ReturnData = result.ToString(); AddResultPackage(pkg); }); } else { Debug.LogError("Pomelo Client is null"); } }
public void LuaTableTest(LuaInterface.LuaTable table) { Debug.Log("LuaTableTest values is: " + table.Length); IEnumerator <DictionaryEntry> tmp = table.ToDictTable().GetEnumerator(); while (tmp.MoveNext()) { DictionaryEntry curr = tmp.Current; Debug.Log("key " + curr.Key + " value: " + curr.Value); } }