Here is the sample code, the following code works fine on Mac OS, but reported the previous error on Windows.
Environment: ES3 3.2.1f1, Unity 2018.4.12f1 / Unity 2019.3.2f1 Windows Standalone.
Is it the wrong way to use ES3?
Code: Select all
public void LoadArchive()
{
try
{
Debug.Log($"Try load archive {ArchiveName} with encrypt key {encryptKey}");
// presume i used a wrong key to decrypt the archive.
_archive = new ES3File(ArchiveName, new ES3Settings(ES3.EncryptionType.AES, encryptKey));
}
catch (Exception e)
{
Debug.Log($"Load failed with key {encryptKey}, delete and re-create");
// delete invalid archive
// IOException: Sharing violation on path will be raised when i tried to delete the file.
ES3.DeleteFile(ArchiveName);
// create a new one
CreateArchive();
}
}