{"id":22878037,"url":"https://github.com/lajawi/unity-save-system","last_synced_at":"2025-03-31T14:18:33.084Z","repository":{"id":267191357,"uuid":"900117222","full_name":"lajawi/unity-save-system","owner":"lajawi","description":"A small Unity package for easily saving and loading custom data in a JSON format.","archived":false,"fork":false,"pushed_at":"2024-12-16T16:03:36.000Z","size":40,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-06T20:24:07.832Z","etag":null,"topics":["game-development","json","unity","unity-3d","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":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lajawi.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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-12-07T22:50:28.000Z","updated_at":"2024-12-11T11:09:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"3a83b530-886d-426d-98ca-7d4132effa31","html_url":"https://github.com/lajawi/unity-save-system","commit_stats":null,"previous_names":["lajawi/unity-save-system"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lajawi%2Funity-save-system","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lajawi%2Funity-save-system/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lajawi%2Funity-save-system/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lajawi%2Funity-save-system/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lajawi","download_url":"https://codeload.github.com/lajawi/unity-save-system/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246481005,"owners_count":20784458,"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":["game-development","json","unity","unity-3d","unity-package","unity-save"],"created_at":"2024-12-13T16:17:39.262Z","updated_at":"2025-03-31T14:18:33.065Z","avatar_url":"https://github.com/lajawi.png","language":"C#","readme":"# Unity Save System\n\nA small Unity package for easily saving and loading custom data in a JSON format.\n\n## Usage\n\nInstall the package according to the [installation instructions](#installation). Once installed, you can use the methods available.\n\n```cs\nusing Lajawi;       // Either add this using to your script,\n                    // or use Lajawi.\u003cmethod\u003e to call the methods\n\npublic class Data   // Example class meant for serializing\n{\n    public int id;\n\n    // All variables that need to be saved,\n    // need to be publicly accessible\n    public string Name { get; private set; }\n\n    public Data(string name)\n    {\n        Name = name;\n    }\n}\n\npublic class GameManager : MonoBehaviour\n{\n    readonly string PATH = \"player\\\\data\";\n\n    void Start()\n    {\n        // Because of Name's setter accessibility, you have\n        // to use the constructor to set it\n        Data data = new Data(\"lajawi\") { id = 1 };\n\n        // Your data will be saved in the persistent datapath\n        // that Unity provides, at your path\n        // In the case of WebGL builds, data will be stored\n        // in the PlayerPrefs instead, with the PATH as key\n        SaveSystem.Save(PATH, data);\n\n        // Retrieve previously saved data with the same path\n        // SaveSystem.Load returns a boolean, to easily check\n        // whether reading the data was successful\n        if (SaveSystem.Load(PATH, out Data readData))\n        {\n            Debug.Log($\"ID: {readData.id}, name: {readData.name}\");\n        }\n\n        // Saving other types, like primitives, lists,\n        // dictionaries, arrays... is possible too\n        SaveSystem.Save(\"string\", \"Hello World!\");\n        SaveSystem.Save(\"List\", new List\u003cint\u003e() { 0, 1, 1, 2, 3, 5 });\n        SaveSystem.Save(\"Dictionary\", new Dictionary\u003cint, string\u003e() {\n            { 0, \"Zero\" },\n            { 2, \"Two\" },\n            { 25, \"Twenty-five\" },\n        });\n\n        // And of course, custom classes with all variables\n        // of any type above will work too\n    }\n}\n```\n\n## Installation\n\n### Option 1: Package Manager (recommended)\n\nOpen the Package Manager window, click on `Add Package from Git URL ...`, then enter the following:\n\n```\nhttps://github.com/lajawi/unity-save-system.git\n```\n\n### Option 2: Manually Editing `package.json`\n\nAdd the following line to your project's `Packages/manifest.json`:\n\n```json\n\"com.github.lajawi.savesystem\": \"https://github.com/lajawi/unity-save-system.git\"\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flajawi%2Funity-save-system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flajawi%2Funity-save-system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flajawi%2Funity-save-system/lists"}