public static string jsonToBase64(string paramJson) { try { SimpleJSON.JSONNode node = SimpleJSON.JSON.Parse(paramJson); return(node.SaveToBase64()); } catch (Exception ex) { Debug.LogError(ex.Message); return(paramJson); } }
static int _m_SaveToBase64(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); SimpleJSON.JSONNode gen_to_be_invoked = (SimpleJSON.JSONNode)translator.FastGetCSObj(L, 1); { string gen_ret = gen_to_be_invoked.SaveToBase64( ); LuaAPI.lua_pushstring(L, gen_ret); return(1); } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } }