{"id":21051723,"url":"https://github.com/unity-package/game-data-unity","last_synced_at":"2025-05-15T21:36:09.757Z","repository":{"id":246502413,"uuid":"821322893","full_name":"wolf-org/game-data-unity","owner":"wolf-org","description":"System game data unity (Unity 2022.3)","archived":false,"fork":false,"pushed_at":"2024-10-24T09:48:49.000Z","size":21,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2024-10-25T07:37:08.951Z","etag":null,"topics":["backup-data","game-data","gamedata","gamedata-unity","restore-data","unity","unity3d"],"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/wolf-org.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-06-28T09:30:44.000Z","updated_at":"2024-10-24T09:48:53.000Z","dependencies_parsed_at":"2024-07-31T08:33:01.687Z","dependency_job_id":"252fad68-609d-4dfb-a101-9c049ded1a15","html_url":"https://github.com/wolf-org/game-data-unity","commit_stats":null,"previous_names":["wolf-package/game-data-unity","wolf-org/game-data-unity"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wolf-org%2Fgame-data-unity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wolf-org%2Fgame-data-unity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wolf-org%2Fgame-data-unity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wolf-org%2Fgame-data-unity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wolf-org","download_url":"https://codeload.github.com/wolf-org/game-data-unity/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225384353,"owners_count":17465879,"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":["backup-data","game-data","gamedata","gamedata-unity","restore-data","unity","unity3d"],"created_at":"2024-11-19T15:59:30.859Z","updated_at":"2025-05-15T21:36:09.726Z","avatar_url":"https://github.com/wolf-org.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"left\"\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/unity-package/game-data-unity?logo=github\"\u003e\n  \u003c/a\u003e\n  \u003ca\u003e\n    \u003cimg alt=\"Last Commit\" src=\"https://img.shields.io/github/last-commit/unity-package/game-data-unity?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/unity-package/game-data-unity?logo=VirtualBox\"\u003e\n  \u003c/a\u003e\n  \u003ca\u003e\n    \u003cimg alt=\"Last Release\" src=\"https://img.shields.io/github/v/release/unity-package/game-data-unity?include_prereleases\u0026logo=Dropbox\u0026color=yellow\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n## What\n\n```mermaid\nflowchart LR\n    Unity.Serialization{Unity.Serialization} --\u003e W(Write) \u0026 R(Read) \n    click Unity.Serialization \"https://docs.unity3d.com/Packages/com.unity.serialization@3.1/manual/index.html\" _blank\n    Data[(\"Data \u003cbr\u003e Profile 0\u003cbr\u003e.\u003cbr\u003e.\u003cbr\u003e.\u003cbr\u003e Profile N \u003cbr\u003e Dictionary\u0026lt;string,byte[]\u003e\")] --\u003e |Default use profile 0| ChangeProfile(ChangeProfile) \n    Data --\u003e |Save on Application pause or quit| SaveToFile(SaveToFile)--\u003e Unity.Serialization\n    Data --\u003e |Load when startup| LoadFromFile(LoadFromFile)--\u003e Unity.Serialization\n    Data --\u003e Get(Get\u0026lt;T\u003e) \u0026 Set(Set\u0026lt;T\u003e) \u0026 DeleteKey(DeleteKey) \u0026 HasKey(HasKey) \u0026 DeleteAll(DeleteAll)\n    File{{File Data}} --- W \u0026 R\n```\n\n- System data for game unity (Unity 2022.3)\n- Using [Unity.Serialization](https://docs.unity3d.com/Packages/com.unity.serialization@3.1/manual/index.html) to serialize binary data\n- Data allows you to store data in byte[] form in blocks called profiles. Each profile is a Dictionary with the key as a string and the value\n## How To Install\n### Add the line below to `Packages/manifest.json`\n\nfor version `1.0.2`\n```json\n\"com.wolf-org.game-data\":\"https://github.com/unity-package/game-data-unity.git#1.0.2\",\n```\n## Use\n\n- Initialize data when loading the game: `GameData.Init()` Data will be init (Load Data) automatically when game starts\n- Change Profile: `GameData.ChangeProfile(int profile)`\n- Load Data: `GameData.Load()` Load all data from file for game\n- Get Data: `GameData.Get(\"KEY\", valueDefault);` Use similar to PlayerPrefs\n- Set Data: `GameData.Set(\"KEY\", value);` Use similar to PlayerPrefs\n- Save Data: `GameData.Save()` Save data to file (You should save when pausing or quitting the game)\n```csharp\n    private void OnApplicationPause(bool pauseStatus)\n    {\n        if(pauseStatus) GameData.Save();\n    }\n```\n- Has Key: `GameData.HasKey(string key)` To check if the profile has a key,\n- DeleteKey: `GameData.DeleteKey(string key)` To delete the key from the profile\n- DeleteAll: `GameData.DeleteAll()` To delete the entire key\n- Backup: `GameData.Backup()` Get raw byte[] of all data of profile\n- Restore: `GameData.Restore(byte[] bytes)` Load from byte[]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funity-package%2Fgame-data-unity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funity-package%2Fgame-data-unity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funity-package%2Fgame-data-unity/lists"}