{"id":15160595,"url":"https://github.com/aleshmandr/pepersistence","last_synced_at":"2026-01-28T07:13:31.017Z","repository":{"id":204449242,"uuid":"711882263","full_name":"Aleshmandr/Pepersistence","owner":"Aleshmandr","description":"Extensible save/load system package for Unity","archived":false,"fork":false,"pushed_at":"2024-10-17T13:26:00.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-07T20:12:38.267Z","etag":null,"topics":["load","persistence","save","save-load","unity","unity3d","unity3d-plugin"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Aleshmandr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-30T11:14:11.000Z","updated_at":"2024-10-17T13:26:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"c7b50a57-9909-40e6-923e-8893e59f2523","html_url":"https://github.com/Aleshmandr/Pepersistence","commit_stats":{"total_commits":16,"total_committers":1,"mean_commits":16.0,"dds":0.0,"last_synced_commit":"3f73ef9da20a3a26b3066592a015d3795d145c92"},"previous_names":["aleshmandr/com.aleshmandr.pepersistence"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aleshmandr%2FPepersistence","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aleshmandr%2FPepersistence/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aleshmandr%2FPepersistence/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aleshmandr%2FPepersistence/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Aleshmandr","download_url":"https://codeload.github.com/Aleshmandr/Pepersistence/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247721900,"owners_count":20985084,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["load","persistence","save","save-load","unity","unity3d","unity3d-plugin"],"created_at":"2024-09-26T23:03:13.582Z","updated_at":"2026-01-28T07:13:31.011Z","avatar_url":"https://github.com/Aleshmandr.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pepersistence\n\nExtensible save/load system package for Unity game engine, designed to simplify the management of game data persistence.\n\n## Installation\nYou can install Pepersistence in one of the following ways:\n\n**Using Unity Package Manager**:\n\n1. Open your Unity project.\n2. Go to the Unity Package Manager via `Window \u003e Package Manager`.\n3. Click on the \"Add package from git URL\" button.\n4. Enter the following URL: `https://github.com/Aleshmandr/Pepersistence.git`.\n\n**Manual Download**:\n\nAlternatively, you can download the source files directly from the [Pepersistence GitHub repository](https://github.com/Aleshmandr/Pepersistence) and import them into your Unity project manually.\n\n**Package dependencies**:\n\nThis package depends on Json.NET by Newtonsoft (`com.unity.nuget.newtonsoft-json` version `3.1.2`)\n\n## How to use\n\nFollow these steps to integrate Pepersistence into your project:\n\n1. Create a class for your global savable game data that implements the `ISaveData` interface:\n\n    ````c#\n    [Serializable]\n    public class GameSaveData : ISaveData\n    {\n        public LevelsSaveData Levels;\n    }\n    ````\n\n    ````c#\n    [Serializable]\n    public struct LevelsSaveData\n    {\n        public int CompletedCount;\n    }\n    ````\n\n2. Create your own persistence manager class by extending the `BasePersistenceManager\u003cT\u003e where T : ISaveData, new()` class:\n\n    ````c#\n    public class PersistenceManager : BasePersistenceManager\u003cGameSaveData\u003e\n    {\n        public PersistenceManager(ISaveSource saveSource) : base(saveSource) { }\n    }\n    ````\n\n3. Ensure that all objects you want to save implement `ISavable\u003cT\u003e where T : ISaveData`:\n\n   ````c#\n    public class LevelsDataManager : ISavable\u003cGameSaveData\u003e\n    {\n        private int completedCount;\n        \n        public void Load(GameSaveData saveData)\n        {\n            completedCount = saveData.Levels.CompletedCount;\n        }\n\n        public void Save(ref GameSaveData saveData)\n        {\n            saveData.Levels.CompletedCount = completedCount;\n        }\n    }\n   ````\n\n\n4. Register all objects you want to save with your `PersistenceManager`:\n   ````c#\n   ...\n   persistenceManager.Register(levelsDataManager);\n   ...\n   ````\n   **Alternatively**, if you use dependency injection (DI) in your project, you can register the necessary objects inside your PersistenceManager:\n\n   ````c#\n   public class PersistenceManager : BasePersistenceManager\u003cSaveData\u003e\n    {\n        public PersistenceManager(ISaveSource saveSource, IReadOnlyList\u003cISavable\u003e savableObjects) : base(saveSource)\n        {\n            foreach (var savableObject in savableObjects)\n            {\n                Register(savableObject);\n            }\n        }\n    }\n   ````\n   Where `LevelsDataManager` implements `ISavable` instead of `ISavable\u003cGameSaveData\u003e`:\n\n   ````c#\n   public interface ISavable : ISavable\u003cSaveData\u003e { }\n   ````\n\n6. Load/save your game data\n   ````c#\n   ...\n   persistenceManager.Load();\n   ...\n   persistenceManager.Save();\n   ````\n\n7. You can delete all save files in the editor by selecting the `Edit \u003e Pepersistence \u003e Clear All Saves`.\n   This action will remove all files with an extension that matches the pattern `^.*sav$`, including the default `.jsav`. \n   Therefore, if you create your own save file format, make sure to use a file extension that matches this pattern, as it will also be removed when clearing saves.\n\n## Features\n\n1. Contains classes for local saves, supporting both binary and JSON formats.\n2. Extensibility: You can implement your custom save source, such as cloud-based saves, to meet your specific needs.\n3. Save file encryprion\n4. Save data migrations\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faleshmandr%2Fpepersistence","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faleshmandr%2Fpepersistence","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faleshmandr%2Fpepersistence/lists"}