Code: Select all
var file = new ES3File("SaveData.es3");
string str = file.LoadRawString();
Debug.Log(str);
Code: Select all
public byte[] LoadRawBytes()
{
if(cache.Count == 0)
return new byte[0];
using (var ms = new System.IO.MemoryStream ())
{
using (var baseWriter = ES3Writer.Create(ms, settings, false, false))
{
foreach (var kvp in cache)
baseWriter.Write(kvp.Key, kvp.Value.type.type, kvp.Value.bytes);
// baseWriter.Save(false);
}
return ms.ToArray();
}
}
P.S. just found out may be I should use ES3.LoadRawString(new ES3Settings()) to print the file string instead...but reporting this anyway.
P.S.2 May be it's handy to have ES3.LoadRawString() with no input which simply return the file string of default file? Same to ES3.FileExists()