public static string jsonToBase64(string paramJson) { try { SimpleJSON.JSONNode node = SimpleJSON.JSON.Parse(paramJson); return(node.SaveToBase64()); } catch (Exception ex) { DebugLogError(ex.Message); return(paramJson); } }
void SaveMapData(JSONNode data) { #if !UNITY_WEBPLAYER if (File.Exists("Assets/Resources/Maps/" + LevelName + ".map")) { Debug.Log(LevelName + " already exist."); return; } // encode later var file = File.CreateText("Assets/Resources/Maps/" + LevelName + ".map"); file.Write(data.SaveToBase64()); file.Close(); #endif }