![]() |
Pro Reset Game
|
Pro Reset Game — SaveManager Universal Save System Documentation v2.0.0
About SaveManager
SaveManager is the core component of Pro Reset Game, a reflection-driven, plug-and-play save system for Unity 2021.3 LTS and later. It captures, encrypts (optional AES-256) and restores any Unity-serialisable data—including custom structs and third-party components—without additional code.
Key Capabilities • Explicit Save Entries – point-and-click selection of individual fields & properties. • [Saveable] Attributes – add one line to mark data for persistence. • Full-field Dump – serialise every Unity-serialisable member on chosen objects. • Slot System – fixed or unlimited slots with automatic filename patterns. • AES-256 Encryption – single-toggle, at-rest file encryption.
Quick-Start
Production Usage – call RecordState() and LoadState() from code (e.g. main-menu buttons, checkpoints, scene loaders).
Technical Details
Requirements • Unity 2021.3 LTS or later • .NET Standard 2.1 API level • No third-party dependencies (AES uses System.Security.Cryptography)
Known Limitations • Saving static fields and non-serialisable types (e.g. open file handles) is not supported. • Reflection-based full-field dumps are heavier on large scenes—prefer explicit entries in performance-critical titles.
Package Content (core files)
| File | Purpose |
|---|---|
PropertyListConfig.cs | ScriptableObject whitelist / blacklist of component properties |
PropertyListConfigEditor.cs | Editor UI for PropertyListConfig |
SaveManager.cs | Runtime manager that captures / restores game state |
SaveManagerEditor.cs | Custom inspector and editor tooling |
SaveableAttribute.cs | Attributes: Saveable, SaveableIgnore, SaveableDefaultReset |
SerlizableType.cs | Wrapper enabling Unity-friendly System.Type serialisation |
SerlizableTypeDrawer.cs | Property drawer for SerializableType |
SerlizationWrapper.cs | Utility for dictionary⇄JSON conversion |
API Reference
| Scope | Return | Method | Parameters | Description |
|---|---|---|---|---|
| public | void | RecordState | — | Capture the current game state and write it to disk using active settings. |
| public | void | LoadState | — | Load the most recent save file (or slot) and restore values. |
| public | void | Save_SaveFileToDisk | int saveSlot | Slot-aware variant of RecordState. |
| public | void | Load_SaveFileFromDisk | int saveSlot | Slot-aware variant of LoadState. |
| public | List<string> | GetAllSaveFileIDs | — | Return a list of every detected slot index or timestamp. |
| public | bool | DeleteSaveFile | string id | Delete a specific save file. Returns true on success. |
| public | void | DumpSavedDataToConsole | — | Debug helper — prints the cached data structure. |
Public Variables (SaveManager)
| Scope | Type | Name | Description |
|---|---|---|---|
| public | bool | SaveAllSerializableFields | When true, serialise every Unity-serialisable field found by reflection. |
| public | bool | SaveEverySingleComponentOrComponentInList | Traverse whole scene or limit to ComponentListToSaveEveryThing. |
| public | List<Component> | ComponentListToSaveEveryThing | Whitelist used when the previous flag is false. |
| public | bool | IncludeBuiltinComponentProperties | Include built-in properties (e.g., Rigidbody.mass) in full-field dumps. |
| public | Component | targetComponent | Inspector helper — ignored at runtime. |
| public | string | variableName | Inspector helper displaying the selected member. |
| public | bool | useSaveEntries | Toggle Explicit Save Entries. |
| public | List<SaveEntry> | saveEntries | Stores per-variable rules. |
| public | bool | useSaveableAttributes | Toggle automatic attribute scanning. |
| public | bool | SaveEverySingleAttributeComponentOrComponentInList | Restrict attribute scan to serializableFieldComponents if false. |
| public | List<MonoBehaviour> | serializableFieldComponents | Whitelist used when above flag is false. |
| public | bool | EnableSaveSlots | Enable fixed-count slot system. |
| public | bool | InfiniteSaveSlots | Allow unlimited slots (timestamp filenames). |
| public | int | AmountOfSaveSlots | Maximum slot count when slots are enabled. |
| public | int | SlotsToSaveTo | Active slot index used by inspector buttons. |
| public | string | SaveSlotName | Filename pattern (must contain INDEX% and end in .json). |
| public | bool | EnableFileEncryption | Toggle AES-256 at-rest encryption. |
| public | string | encryptionPassword | 48-character passphrase (first 32 chars → key, last 16 → IV). |
Attributes
| Name | Purpose |
|---|---|
Saveable | Marks a field/property for persistence. |
SaveableDefaultReset | Supplies a JSON-compatible default when no saved data exist. |
SaveableIgnore | Explicitly exclude a member, even if Saveable is present. |
Enums
| Enum | Options | Purpose |
|---|---|---|
PropertyListConfig.InclusionMode | Whitelist, Blacklist | Determine whether the property list acts as an allow-list or block-list. |
Document Revision History
| Date | Version | Notes |
|---|---|---|
| 2023-10-28 | 1.0.0 | Initial release. |
| 2024-07-17 | 2.0.0 | Dynamic serialisation, full type support, UI overhaul. |