Skip to content

Commit 8b64888

Browse files
committed
- update readme
1 parent 1371f3d commit 8b64888

File tree

2 files changed

+39
-5
lines changed

2 files changed

+39
-5
lines changed

README.md

+35-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,40 @@
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>
218

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
324
### Add the line below to `Packages/manifest.json`
425

5-
for version `x.x.x`
26+
for version `1.0.0`
627
```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",
829
```
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

package.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "com.wolf-package.game-data",
33
"displayName": "UnityCommon-GameData",
4-
"description": "System game data for game unity",
4+
"description": "System data for game unity",
55
"version": "1.0.0",
66
"unity": "2021.3",
77
"category": "virtuesky",
@@ -16,5 +16,7 @@
1616
"Unity",
1717
"GameData"
1818
],
19-
"dependencies": {}
19+
"dependencies": {
20+
"com.unity.serialization": "3.1.1"
21+
}
2022
}

0 commit comments

Comments
 (0)