Skip to content

Commit 41b36dd

Browse files
committed
Update README.md
1 parent 8b64888 commit 41b36dd

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

README.md

+12-6
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,15 @@ for version `1.0.0`
3232
- Initialize data when loading the game: `GameData.Init()`
3333
- Change Profile: `GameData.ChangeProfile(int profile)`
3434
- 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
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+
```csharp
39+
private void OnApplicationPause(bool pauseStatus)
40+
{
41+
if(pauseStatus) GameData.Save();
42+
}
43+
```
44+
- Has Key: `GameData.HasKey(string key)` To check if the profile has a key,
45+
- DeleteKey: `GameData.DeleteKey(string key)` To delete the key from the profile
46+
- DeleteAll: `GameData.DeleteAll()` To delete the entire key

0 commit comments

Comments
 (0)