From 44e1916c93f53f59ec65eb8f29e3c73360b82b80 Mon Sep 17 00:00:00 2001 From: Barnaby Smith Date: Wed, 3 Aug 2022 00:54:20 +0100 Subject: [PATCH] * Fix #9 - floats not being parsed properly --- Editor/PlayerPrefsEditor.cs | 6 +++- README.md | 62 ++++++++++++++++++++++++++++++++----- package.json | 2 +- 3 files changed, 60 insertions(+), 10 deletions(-) diff --git a/Editor/PlayerPrefsEditor.cs b/Editor/PlayerPrefsEditor.cs index d985c32..b246d83 100644 --- a/Editor/PlayerPrefsEditor.cs +++ b/Editor/PlayerPrefsEditor.cs @@ -379,7 +379,7 @@ private PlayerPrefPair[] RetrieveSavedPrefs(string companyName, string productNa // Unfortunately floats will come back as an int (at least on 64 bit) because the float is stored as // 64 bit but marked as 32 bit - which confuses the GetValue() method greatly! - if (ambiguousValue.GetType() == typeof(int)) + if (ambiguousValue.GetType() == typeof(int) || ambiguousValue.GetType() == typeof(long)) { // If the PlayerPref is not actually an int then it must be a float, this will evaluate to true // (impossible for it to be 0 and -1 at the same time) @@ -893,6 +893,10 @@ private void DrawMainList() GUI.Label(typeRect, "string"); } } + else + { + GUI.Label(valueRect, "Unsupported: " + valueType.ToString()); + } // Delete button if (GUI.Button(rightRect, new GUIContent((Texture2D) EditorGUIUtility.TrIconContent("winbtn_mac_close_h").image, "Delete Pref"))) diff --git a/README.md b/README.md index 7398857..87e4697 100644 --- a/README.md +++ b/README.md @@ -7,13 +7,13 @@ PlayerPrefs Editor & Utilities provide an easy way to see what PlayerPrefs your game is using and change them at run-time. It also includes encryption support to protect your player prefs from casual hacking and has additional support for more data types. Editor features include: -- list all active PlayerPrefs -- search for PlayerPrefs to refine results -- change PlayerPref values at run-time -- add new PlayerPrefs -- delete PlayerPrefs +- list all active PlayerPrefs and EditorPrefs +- search for prefs to refine results +- change pref values at run-time +- add new prefs +- delete prefs - quick delete all button -- import Player Prefs from another project +- import prefs from another project - supports working with the encryption features added in the utilities Utilities features include: @@ -30,7 +30,7 @@ For a more comprehensive quick start guide and API documentation please go to ht ## PlayerPrefs Editor -To open the PlayersPrefs Editor go to Window -> Player Prefs Editor +To open the PlayersPrefs Editor go to Window -> PlayerPrefs Editor This will open an editor window which you can dock like any other Unity window. @@ -57,6 +57,52 @@ To delete an existing player pref, click the X button next to the player pref in ## PlayerPrefs Utilities -IMPORTANT: If using encryption, make sure you change the key specified in SimpleEncryption.cs, this will make sure your key is unique and make the protection stronger. +IMPORTANT: If using encryption, make sure you create a custom key under More Options, this will make sure your key is unique and make the protection stronger. In PlayerPrefsUtility.cs you'll find a set of utility methods for dealing with encryption and also new data types. There is documentation within this file explaining how each method works. There is also additional documentation at http://sabresaurus.com/docs/playerprefs-editor-utilities-documentation/ + +# License + +Licensed under MIT, see **LICENSE** for details. + +# Installation + +
+Add from OpenUPM | via scoped registry, recommended + +This package is available on OpenUPM: https://openupm.com/packages/com.sabresaurus.playerprefseditor/ + +To add it the package to your project: + +- open `Edit/Project Settings/Package Manager` +- add a new Scoped Registry: + ``` + Name: OpenUPM + URL: https://package.openupm.com/ + Scope(s): com.sabresaurus + ``` +- click Save +- open Package Manager +- click + +- select Add from Git URL +- paste `com.sabresaurus.sidekick` +- click Add +
+ +
+Add from GitHub | not recommended, no updates through UPM + +You can also add it directly from GitHub on Unity 2020.3+. Note that you won't be able to receive updates through Package Manager this way, you'll have to update manually. + +- open Package Manager +- click + +- select Add from Git URL +- paste `https://github.com/sabresaurus/PlayerPrefsEditor.git` +- click Add +**or** +- Edit your `Packages/manifest.json` file to contain `"com.sabresaurus.playerprefseditor": "https://github.com/sabresaurus/PlayerPrefsEditor.git"`, + +To update the package with new changes, remove the lock from the `Packages/packages-lock.json` file. +
+ +To open the window go to `Window → PlayerPrefs Editor` \ No newline at end of file diff --git a/package.json b/package.json index a7d18dd..8c996a5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "com.sabresaurus.playerprefseditor", - "version": "1.4.0", + "version": "1.4.1", "displayName": "PlayerPrefs Editor & Utilities", "description": "PlayerPrefs Editor & Utilities provide an easy way to see what PlayerPrefs your game is using and change them at run-time.", "unity": "2019.4",