From 37ceb691b63b4d8ef68481ad1ed1072b776d2c9a Mon Sep 17 00:00:00 2001 From: Ivan Murzak Date: Thu, 9 Feb 2023 15:41:58 -0800 Subject: [PATCH] Update README.md --- Assets/_PackageRoot/README.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Assets/_PackageRoot/README.md b/Assets/_PackageRoot/README.md index ba7ae3d..c5f2382 100644 --- a/Assets/_PackageRoot/README.md +++ b/Assets/_PackageRoot/README.md @@ -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("key"); PlayerPrefsEx.SetJson("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("key"); PlayerPrefsEx.SetJson("key", new Player()); <--- Generic ``` ### Variables API Usage @@ -99,7 +98,8 @@ There are two ways to do that ``` C# var player = new PlayerPrefsJson("player"); ``` -## 2. Or to create dedicated class for more clean usage using `PlayerPrefsEx` +## 2. Using `PlayerPrefsEx` +Create dedicated class for more clean usage. ``` C# var enemy = PlayerPrefsEnemy("enemy"); enemy.Value = new Enemy();