From 5a61470d8d8ef39ab9c871254c6419e38ae8be27 Mon Sep 17 00:00:00 2001 From: Hasan Bayat Date: Thu, 12 May 2022 10:04:06 +0430 Subject: [PATCH] Fix LoadInto error for encryption --- .../Bayat/SaveSystem/Runtime/PluginVersion.cs | 2 +- .../Bayat/SaveSystem/Runtime/SaveSystemAPI.cs | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Assets/Plugins/Bayat/SaveSystem/Runtime/PluginVersion.cs b/Assets/Plugins/Bayat/SaveSystem/Runtime/PluginVersion.cs index d136559..9a763fa 100644 --- a/Assets/Plugins/Bayat/SaveSystem/Runtime/PluginVersion.cs +++ b/Assets/Plugins/Bayat/SaveSystem/Runtime/PluginVersion.cs @@ -16,7 +16,7 @@ public static class PluginVersion /// /// The plugin's version. /// - public static readonly Version Version = new Version(1, 20, 3); + public static readonly Version Version = new Version(1, 20, 4); } diff --git a/Assets/Plugins/Bayat/SaveSystem/Runtime/SaveSystemAPI.cs b/Assets/Plugins/Bayat/SaveSystem/Runtime/SaveSystemAPI.cs index 0b0cc61..d28b532 100644 --- a/Assets/Plugins/Bayat/SaveSystem/Runtime/SaveSystemAPI.cs +++ b/Assets/Plugins/Bayat/SaveSystem/Runtime/SaveSystemAPI.cs @@ -1,9 +1,11 @@ -using Bayat.SaveSystem.Security; -using Bayat.SaveSystem.Storage; -using System; +using System; using System.Collections.Generic; using System.IO; using System.Threading.Tasks; + +using Bayat.SaveSystem.Security; +using Bayat.SaveSystem.Storage; + using UnityEngine; namespace Bayat.SaveSystem @@ -517,6 +519,11 @@ public static async Task LoadIntoAsync(string identifier, object target, } } if (isEncrypted) + { + cryptoStream = encryption.GetReadStream(stream, password); + underlyingStream = cryptoStream.UnderlyingCryptoStream; + } + if (isEncrypted) { try {