SaveToBase64() public method

public SaveToBase64 ( ) : string
return string
Esempio n. 1
0
 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);
     }
 }
Esempio n. 2
0
    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
    }