{"id":19704261,"url":"https://github.com/rimurudev/unity-jsonsaveloadservice","last_synced_at":"2025-11-22T14:02:57.409Z","repository":{"id":224885763,"uuid":"764496330","full_name":"RimuruDev/Unity-JsonSaveLoadService","owner":"RimuruDev","description":"🐈JsonSaveLoadService is a flexible and powerful service designed for saving and loading data in Unity applications. It supports various data types including primitives, custom objects, and collections like Dictionary, HashSet, List, Queue, and Stack. This service ensures cross-platform compatibility (PC, Android, Web) and includes functionality fo","archived":false,"fork":false,"pushed_at":"2024-03-01T08:42:12.000Z","size":20,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-10T11:47:57.707Z","etag":null,"topics":["json","json-data","local-save","newtonsoft-json","rimuru-dev","rimurudev","save","save-load","save-load-model","save-system","serialization","simple-json","unity-json","unity-package","unity-save"],"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/RimuruDev.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":"2024-02-28T07:19:25.000Z","updated_at":"2024-08-06T20:22:44.000Z","dependencies_parsed_at":"2024-03-01T09:39:04.703Z","dependency_job_id":"4f762e94-9445-41bb-aaa8-a9419631e948","html_url":"https://github.com/RimuruDev/Unity-JsonSaveLoadService","commit_stats":null,"previous_names":["rimurudev/unity-jsonsaveloadservice"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RimuruDev%2FUnity-JsonSaveLoadService","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RimuruDev%2FUnity-JsonSaveLoadService/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RimuruDev%2FUnity-JsonSaveLoadService/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RimuruDev%2FUnity-JsonSaveLoadService/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RimuruDev","download_url":"https://codeload.github.com/RimuruDev/Unity-JsonSaveLoadService/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241019976,"owners_count":19895352,"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":["json","json-data","local-save","newtonsoft-json","rimuru-dev","rimurudev","save","save-load","save-load-model","save-system","serialization","simple-json","unity-json","unity-package","unity-save"],"created_at":"2024-11-11T21:21:35.931Z","updated_at":"2025-11-22T14:02:52.376Z","avatar_url":"https://github.com/RimuruDev.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e🐈 Json Save Load Service 🐈\u003c/h1\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca\u003e\n    \u003cimg alt=\"Made With Unity\" src=\"https://img.shields.io/badge/made%20with-Unity-57b9d3.svg?logo=Unity\"\u003e\n  \u003c/a\u003e\n  \u003ca\u003e\n    \u003cimg alt=\"License\" src=\"https://img.shields.io/github/license/RimuruDev/Unity-JsonSaveLoadService?logo=github\"\u003e\n  \u003c/a\u003e\n  \u003ca\u003e\n    \u003cimg alt=\"Last Commit\" src=\"https://img.shields.io/github/last-commit/RimuruDev/Unity-JsonSaveLoadService?logo=Mapbox\u0026color=orange\"\u003e\n  \u003c/a\u003e\n  \u003ca\u003e\n    \u003cimg alt=\"Repo Size\" src=\"https://img.shields.io/github/repo-size/RimuruDev/Unity-JsonSaveLoadService?logo=VirtualBox\"\u003e\n  \u003c/a\u003e\n  \u003ca\u003e\n    \u003cimg alt=\"Downloads\" src=\"https://img.shields.io/github/downloads/RimuruDev/Unity-JsonSaveLoadService/total?color=brightgreen\"\u003e\n  \u003c/a\u003e\n  \u003ca\u003e\n    \u003cimg alt=\"Last Release\" src=\"https://img.shields.io/github/v/release/RimuruDev/Unity-JsonSaveLoadService?include_prereleases\u0026logo=Dropbox\u0026color=yellow\"\u003e\n  \u003c/a\u003e\n  \u003ca\u003e\n    \u003cimg alt=\"GitHub stars\" src=\"https://img.shields.io/github/stars/RimuruDev/Unity-JsonSaveLoadService?branch=main\u0026label=Stars\u0026logo=GitHub\u0026logoColor=ffffff\u0026labelColor=282828\u0026color=informational\u0026style=flat\"\u003e\n  \u003c/a\u003e\n  \u003ca\u003e\n    \u003cimg alt=\"GitHub user stars\" src=\"https://img.shields.io/github/stars/RimuruDev?affiliations=OWNER\u0026branch=main\u0026label=User%20Stars\u0026logo=GitHub\u0026logoColor=ffffff\u0026labelColor=282828\u0026color=informational\u0026style=flat\"\u003e\n  \u003c/a\u003e\n  \u003ca\u003e\n    \u003cimg alt=\"\" src=\"https://img.shields.io/github/watchers/RimuruDev/Unity-JsonSaveLoadService?style=flat\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\n## Overview\n`JsonSaveLoadService` is a flexible and powerful service designed for saving and loading data in Unity applications. It supports various data types including primitives, custom objects, and collections like Dictionary, HashSet, List, Queue, and Stack. This service ensures cross-platform compatibility (PC, Android, Web) and includes functionality for handling default values when loading data for the first time.\n\n## Dependencies\nThis service requires the Newtonsoft.Json library for JSON serialization and deserialization. Specifically, it depends on the Unity package `com.unity.nuget.newtonsoft-json` version `3.2.1`.\n\n## Installing Newtonsoft.Json in Unity\nTo use `JsonSaveLoadService` in your project, you must first ensure that Newtonsoft.Json is properly installed. Follow these steps to install the Newtonsoft.Json package through Unity's Package Manager:\n\n1. Open your Unity project.\n2. Navigate to `Window` \u003e `Package Manager`.\n3. Click the `+` button in the top left corner of the Package Manager window.\n4. Select `Add package from git URL...`.\n5. Enter `com.unity.nuget.newtonsoft-json@3.2.1` and click `Add`.\n6. Unity will download and install the Newtonsoft.Json package.\n\nAlternatively, you can manually edit your project's `Packages/manifest.json` file to include the following line in the `dependencies` section:\n\n```json\n\"com.unity.nuget.newtonsoft-json\": \"3.2.1\"\n```\n\n## Usage\n\n### Saving Data\n```csharp\nvar saveLoadService = new JsonSaveLoadService();\n\n// Saving a simple data type :D\nint highScore = 100;\nsaveLoadService.Save(highScore, \"highScore\");\n\n// Saving a custom object :D\nvar playerData = new PlayerData { Name = \"Rimuru\", Level = 10 };\nsaveLoadService.Save(playerData, \"playerData\");\n\n// Saving a collection :D\nvar scores = new List\u003cint\u003e { 100, 200, 300 };\nsaveLoadService.Save(scores, \"scores\");\n```\n\n### Loading Data\n```csharp\nvar loadedHighScore = saveLoadService.Load(\"highScore\", 0);\nvar loadedPlayerData = saveLoadService.Load(\"playerData\", new PlayerData());\nvar loadedScores = saveLoadService.Load(\"scores\", new List\u003cint\u003e());\n```\n\n### Working with Collections\n- **Dictionary**: Save and load `Dictionary\u003cTKey, TValue\u003e` collections.\n    ```csharp\n    var monsterConfigs = new Dictionary\u003cint, MonsterConfig\u003e\n    {\n        { 1, new MonsterConfig { /* Initialization */ } },\n    };\n    saveLoadService.Save(monsterConfigs, \"monsterConfigs\");\n\n    var loadedMonsterConfigs = saveLoadService.Load(\"monsterConfigs\", new Dictionary\u003cint, MonsterConfig\u003e());\n    ```\n\n- **HashSet**: Save and load `HashSet\u003cT\u003e` collections.\n    ```csharp\n    var uniqueItems = new HashSet\u003cstring\u003e { \"Sword\", \"Shield\" };\n    saveLoadService.Save(uniqueItems, \"uniqueItems\");\n\n    var loadedUniqueItems = saveLoadService.Load(\"uniqueItems\", new HashSet\u003cstring\u003e());\n    ```\n\n- **List**: Save and load `List\u003cT\u003e` collections.\n    ```csharp\n    var itemList = new List\u003cstring\u003e { \"Apple\", \"Banana\" };\n    saveLoadService.Save(itemList, \"itemList\");\n\n    var loadedItemList = saveLoadService.Load(\"itemList\", new List\u003cstring\u003e());\n    ```\n\n- **Queue**: Save and load `Queue\u003cT\u003e` collections.\n    ```csharp\n    var messageQueue = new Queue\u003cstring\u003e();\n    messageQueue.Enqueue(\"Hello\");\n    messageQueue.Enqueue(\"World\");\n    saveLoadService.Save(messageQueue, \"messageQueue\");\n\n    var loadedMessageQueue = saveLoadService.Load(\"messageQueue\", new Queue\u003cstring\u003e());\n    ```\n\n- **Stack**: Save and load `Stack\u003cT\u003e` collections.\n    ```csharp\n    var undoCommands = new Stack\u003cstring\u003e();\n    undoCommands.Push(\"Command1\");\n    undoCommands.Push(\"Command2\");\n    saveLoadService.Save(undoCommands, \"undoCommands\");\n\n    var loadedUndoCommands = saveLoadService.Load(\"undoCommands\", new Stack\u003cstring\u003e());\n    ```\n\n## Editor-Only Custom Path\nFor ease of debugging and testing in the Unity Editor, `JsonSaveLoadService` allows specifying a custom save path:\n\n```csharp\n#if UNITY_EDITOR\nJsonSaveLoadService.SetCustomPathInEditor(\"Assets/Saves\");\n#endif\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frimurudev%2Funity-jsonsaveloadservice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frimurudev%2Funity-jsonsaveloadservice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frimurudev%2Funity-jsonsaveloadservice/lists"}