I started to use ES2Writer and ES2Reader, and I have two issues and 1 question:
1. I have a simple Level class-
Code: Select all
[Serializable]
public class Level
{
public string levelName;
public int target, scores;
bool unlocked;
}
I know that I can write int[] but what about a custom class like my Level class? Is it a type I can add?
I basically need to be able to do- reader.ReadArray<Level>("levelArrayTag");
What's the best way to save it together with my other keys in that file?
2. I keep getting this error- CryptographicException: Invalid input block size.
Mono.Security.Cryptography.SymmetricTransform.FinalDecrypt (System.Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/Mono.Security.Cryptography/SymmetricTransform.cs:462)..............
I removed the data files, but I'm still getting the same error
I enabled the password through the editor (ES2). Not sure why it keeps happening.
3. Regarding ES2Writer, and it might be a stupid question but I want to make sure-
you commented that "you should not open multiple ES2Readers or ES2Writers for the same file"
Do I need to create 1 global writer/reader, and all other classes should use the same one I created? Something like-
Code: Select all
using(OtherClass.instance.reader = ES2Reader.Create("myFile.txt"))
{
...
}
Thanks! I'm getting there......