I am trying to load save some textures2D (which are used for mini map fog of war) in to Cache memory for playstation 4/5 platform.
For pc/mac/linux I load/save them into files and works perfect.
But for storing to Chace the saveImage() seems to have issues.
When saving (with Chace setting) i get this error :
Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.
Am I forgetting some settings or is in not possible to store into Chace.
the files in pc version are between 5 and 10 kb only.
maybe I can convert to byte or something else then save into Chace?
or should i look into Playmakers Save plugin to save those images.
thanks in advance for any suggestion
here are my es3Settings :
Code: Select all
#region ES3 Settings
es3Settings.path = Globals.saveSlot;
es3Settings.location = ES3.Location.Cache;
es3Settings.encryptionType = ES3.EncryptionType.AES;
es3Settings.encryptionPassword = pw;
es3Settings.directory = ES3.Directory.PersistentDataPath;
es3Settings.format = ES3.Format.JSON;
es3Settings.bufferSize = 2048;
#endregion
Code: Select all
private void SaveMapMasks()
{
for (int i = 0; i < pData.mapMasksNames.Length; i++)
{
if (pData.mapMasks[i] != null) ES3.SaveImage((Texture2D)pData.mapMasks[i], 75, Globals.saveSlot + pData.mapMasksNames + ".png", es3Settings);
}
}
Code: Select all
ES3.Save<object>(Globals.saveSlot + "Currency", pData.currency, es3Settings);
ES3.Save<object>(Globals.saveSlot + "currentArmor", pData.currentArmor, es3Settings);
ES3.Save<object>(Globals.saveSlot + "ManaLevel", pData.manaLevel, es3Settings);
ES3.Save<object>(Globals.saveSlot + "HealthLevel", pData.healthLevel, es3Settings);
Code: Select all
ES3.Save<GearData[]>(Globals.saveSlot + "SO_EQPGear", pInv.eqpGear, es3Settings);
ES3.Save<GearData[]>(Globals.saveSlot + "SO_INVGear", pInv.invGear, es3Settings);
ES3.Save<GearData[]>(Globals.saveSlot + "SO_VaultGear", pInv.vaultGear, es3Settings);
Code: Select all
private void SaveFactionLevels()
{
_dict.Clear();
for (int i = 0; i < pData.factionLevelsNames.Length; i++)
{
_dict[pData.factionLevelsNames[i]] = pData.factionLevels[i];
}
ES3.Save<Dictionary<string, object>>(Globals.saveSlot + "Faction levels Hash V2", _dict, es3Settings);
}
Djaydino