Add a custom key for if someone makes a mod of the game it won't clash with the main savefile

This commit is contained in:
2025-08-20 13:25:18 -07:00
parent b9becd25a1
commit e38a37801b
2 changed files with 3 additions and 2 deletions

View File

@@ -44,7 +44,7 @@ public class BazookaManager : MonoBehaviour
public void Load()
{
string path = Path.Join(Application.persistentDataPath, "BazookaManager.dat");
string path = Path.Join(Application.persistentDataPath, SensitiveInfo.BAZOOKA_MANAGER_FILE_KEY + ".dat");
if (!File.Exists(path))
{
File.Create(path).Dispose();
@@ -68,7 +68,7 @@ public class BazookaManager : MonoBehaviour
#if UNITY_EDITOR
return;
#else
string path = Path.Join(Application.persistentDataPath, "BazookaManager.dat");
string path = Path.Join(Application.persistentDataPath, SensitiveInfo.BAZOOKA_MANAGER_FILE_KEY + "BazookaManager.dat");
var encoded = SensitiveInfo.EncryptRaw(saveFile.ToString(Formatting.None), SensitiveInfo.BAZOOKA_MANAGER_KEY);
if (encoded == null) return;
using var fileStream = new FileStream(path, FileMode.Create, FileAccess.Write, FileShare.None);