GameVault supports two types of save systems currently.
- Registry based save system using PlayerPrefs
- Local save system used optionally encrypted JSON files
Use user’s platform registry for lightweight and quick storage. Only supports three datatypes:
- String
- Float
- Int
GameVault.factory.RegSaveSystem.Save("volume", 0.8f);float volume = GameVault.factory.RegSaveSystem.Load<float>("volume", 1.0f);Use JSON files to store structured data.
First you need to create datamodel making sure, it inherits from SavableData and is marked [System.Serializable].
[System.Serializable]
public class datamodel : SavableData
{
public int gold;
public int exilir;
public SavableDictionary<string, string> clothes = new SavableDictionary<string, string>();
public SavableDictionary<int, string> weapons = new SavableDictionary<int, string>();
}Default slot is _global_
GameVault.factory.LocalSaveSystem.Save(SavableData datamodel, string slot);PlayerData data = GameVault.factory.LocalSaveSystem.Load<datamodel>(string slot);GameVault supports primitive types, dictionaries, and custom serializable classes.
SaveToJson only converts the dictionary to JSON.
SavableDictionary<string, int> scores = new SavableDictionary<string, int>();
scores.Add("level1", 100);
string json = scores.SaveToJson();SavableDictionary<string, int> loadedScores = new SavableDictionary<string, int>();
loadedScores.LoadFromJson(json);GameVault uses AES encryption for secure file storage.
GameVault.factory.Settings.EnableEncryption = true;GameVault.factory.Settings.EncryptionKey = "MySecretKey123";- Ensure
GameVaultis initialized before use. - Registry Save is platform-dependent.
- Local Save System requires read/write permissions.
GameVault provides a simple, secure, and scalable way to manage game saves in Unity.