|
1 |
| -## How To Install |
| 1 | +<p align="left"> |
| 2 | + <a> |
| 3 | + <img alt="Made With Unity" src="https://img.shields.io/badge/made%20with-Unity-57b9d3.svg?logo=Unity"> |
| 4 | + </a> |
| 5 | + <a> |
| 6 | + <img alt="License" src="https://img.shields.io/github/license/wolf-package/game-data-unity?logo=github"> |
| 7 | + </a> |
| 8 | + <a> |
| 9 | + <img alt="Last Commit" src="https://img.shields.io/github/last-commit/wolf-package/game-data-unity?logo=Mapbox&color=orange"> |
| 10 | + </a> |
| 11 | + <a> |
| 12 | + <img alt="Repo Size" src="https://img.shields.io/github/repo-size/wolf-package/game-data-unity?logo=VirtualBox"> |
| 13 | + </a> |
| 14 | + <a> |
| 15 | + <img alt="Last Release" src="https://img.shields.io/github/v/release/wolf-package/game-data-unity?include_prereleases&logo=Dropbox&color=yellow"> |
| 16 | + </a> |
| 17 | +</p> |
2 | 18 |
|
| 19 | +## What |
| 20 | +- System data for game unity |
| 21 | +- Using [Unity.Serialization ](https://docs.unity3d.com/Packages/[email protected]/manual/index.html) to serialize binary data |
| 22 | +- 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 |
| 23 | +## How To Install |
3 | 24 | ### Add the line below to `Packages/manifest.json`
|
4 | 25 |
|
5 |
| -for version `x.x.x` |
| 26 | +for version `1.0.0` |
6 | 27 | ```csharp
|
7 |
| -"com.virtuesky._package_name_":"https://github.com/VirtueSky/_package_name_.git#x.x.x", |
| 28 | +"com.wolf-package.game-data":"https://github.com/wolf-package/game-data-unity.git#1.0.0", |
8 | 29 | ```
|
| 30 | +## Use |
| 31 | + |
| 32 | +- Initialize data when loading the game: `GameData.Init()` |
| 33 | +- Change Profile: `GameData.ChangeProfile(int profile)` |
| 34 | +- Load Data: `GameData.Load()` Load all data from file for game, data will be loaded automatically when starting the game |
| 35 | +- Get Data: `GameData.Get("KEY", valueDefault);` use similar to PlayerPrefs |
| 36 | +- Set Data: `GameData.Set("KEY", value);` use similar to PlayerPrefs |
| 37 | +- Save Data: `GameData.Save()` save data to file (You should save when pausing or quitting the game) |
| 38 | +- Has Key: `GameData.HasKey(string key)` to check if the profile has a key, |
| 39 | +- DeleteKey: `GameData.DeleteKey(string key)`to delete the key from the profile |
| 40 | +- DeleteAll: `GameData.DeleteAll()` to delete the entire key |
0 commit comments