A production-grade save system for Unity with encryption, compression, and multi-profile support.
LockBox provides a static API for persisting game data with AES-256 encryption, GZip compression, and automatic type serialization. Supports primitives, collections, Unity types (Vector3, Quaternion, Color), custom classes, and multidimensional arrays up to 6D.
- AES-256 Encryption: Secure save files with CBC mode and random IV
- GZip Compression: Reduces file size by approximately 80%
- Multi-Profile System: Multiple save slots with isolated data
- Auto-Save: Configurable interval-based and exit-triggered saves
- Type Support: Primitives, Lists, Arrays (1D-6D), Unity structs, custom classes, SerializableDictionary
- Async Operations: Non-blocking save operations for large datasets
- Backup System: Automatic 3-tier backup rotation
- Thumbnail Support: Screenshot capture for visual save slot previews
- Version Management: Built-in save migration system
- WebGL Compatible: localStorage integration via jslib
- Editor Debugger: GUI tool for inspecting and editing save files
- Zero Dependencies: No third-party libraries required
- Import the package into your Unity project
- Create a
Resourcesfolder inAssetsif it doesn't exist - Right-click in
Resources→ Create → LockBox → Settings - Configure encryption key (must be 16, 24, or 32 characters)
- Add
using UnityEngine;and start usingLockBox.Save()/LockBox.Load()
using UnityEngine;
public class GameManager : MonoBehaviour
{
void Start()
{
// Save data
LockBox.Save("PlayerName", "Alice");
LockBox.Save("Score", 1000);
LockBox.Save("Position", new Vector3(10, 5, 10));
LockBox.SaveDisk();
// Load data
string name = LockBox.Load<string>("PlayerName");
int score = LockBox.Load<int>("Score", 0); // Default value: 0
Vector3 pos = LockBox.Load<Vector3>("Position");
}
}- Windows, Mac, Linux
- iOS, Android
- WebGL (requires jslib plugin)
- Console platforms (tested on Switch, PlayStation, Xbox)
- Save operation: ~2ms for 1000 Vector3 entries (with compression + encryption)
- Load operation: ~1ms for 1000 Vector3 entries
- File size: 2.4KB for 1000 Vector3 entries (compressed), 40KB uncompressed
MIT License - See LICENSE file for details
See Documentation.md for complete API reference and advanced usage.