Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanMurzak committed Feb 9, 2023
1 parent 24a2042 commit 37ceb69
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions Assets/_PackageRoot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,22 @@

Lightweight package with optimized advanced version of PlayerPrefs. Under the hood it uses the same PlayerPrefs system, but creates flexible wrapper for default system.


### Static API Usage
``` C#
using Extensions.Unity.PlayerPrefsEx;

// Static Getters // Static Setters
PlayerPrefsEx.GetInt("key"); PlayerPrefsEx.SetInt("key", 10);
PlayerPrefsEx.GetBool("key"); PlayerPrefsEx.SetBool("key", false);
PlayerPrefsEx.GetFloat("key"); PlayerPrefsEx.SetFloat("key", 2.123f);
PlayerPrefsEx.GetString("key"); PlayerPrefsEx.SetString("key", "hello world");
PlayerPrefsEx.GetBigInt("key"); PlayerPrefsEx.SetBigInt("key", BigInteger.Parse("100"));
PlayerPrefsEx.GetDateTime("key"); PlayerPrefsEx.SetDateTime("key", DateTime.Now);
PlayerPrefsEx.GetVector2("key"); PlayerPrefsEx.SetVector2("key", Vector2.up);
PlayerPrefsEx.GetVector2Int("key"); PlayerPrefsEx.SetVector2Int("key", Vector2Int.up);
PlayerPrefsEx.GetVector3("key"); PlayerPrefsEx.SetVector3("key", Vector3.up);
PlayerPrefsEx.GetVector3Int("key"); PlayerPrefsEx.SetVector3Int("key", Vector3Int.up);
PlayerPrefsEx.GetJson<Player>("key"); PlayerPrefsEx.SetJson<Player>("key", new Player()); // <<<-------- Generic
PlayerPrefsEx.GetInt("key"); PlayerPrefsEx.SetInt("key", 10);
PlayerPrefsEx.GetBool("key"); PlayerPrefsEx.SetBool("key", false);
PlayerPrefsEx.GetFloat("key"); PlayerPrefsEx.SetFloat("key", 2.123f);
PlayerPrefsEx.GetString("key"); PlayerPrefsEx.SetString("key", "hello world");
PlayerPrefsEx.GetBigInt("key"); PlayerPrefsEx.SetBigInt("key", BigInteger.Parse("100"));
PlayerPrefsEx.GetDateTime("key"); PlayerPrefsEx.SetDateTime("key", DateTime.Now);
PlayerPrefsEx.GetVector2("key"); PlayerPrefsEx.SetVector2("key", Vector2.up);
PlayerPrefsEx.GetVector2Int("key"); PlayerPrefsEx.SetVector2Int("key", Vector2Int.up);
PlayerPrefsEx.GetVector3("key"); PlayerPrefsEx.SetVector3("key", Vector3.up);
PlayerPrefsEx.GetVector3Int("key"); PlayerPrefsEx.SetVector3Int("key", Vector3Int.up);
PlayerPrefsEx.GetJson<Player>("key"); PlayerPrefsEx.SetJson<Player>("key", new Player()); <--- Generic
```

### Variables API Usage
Expand Down Expand Up @@ -99,7 +98,8 @@ There are two ways to do that
``` C#
var player = new PlayerPrefsJson<Player>("player");
```
## 2. Or to create dedicated class for more clean usage using `PlayerPrefsEx<T>`
## 2. Using `PlayerPrefsEx<T>`
Create dedicated class for more clean usage.
``` C#
var enemy = PlayerPrefsEnemy("enemy");
enemy.Value = new Enemy();
Expand Down

0 comments on commit 37ceb69

Please sign in to comment.