Skip to content

Commit e269052

Browse files
committed
[v0.0.5-pre.1] Fix prefs save mapping
1 parent 10c6c82 commit e269052

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

Runtime/Storage/PlayerPrefsPersistentStorage.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: Apache-2.0
2-
// © 2023-2024 Nikolay Melnikov <[email protected]>
2+
// © 2023-2025 Depra <[email protected]>
33

44
using System;
55
using System.Collections.Generic;
@@ -18,15 +18,19 @@ void IPersistentStorage.Save(string key, IPersistent persistent, bool overwrite)
1818

1919
if (type == typeof(string))
2020
{
21-
PlayerPrefs.SetString(key, (string) state);
21+
PlayerPrefs.SetString(key, (string)state);
2222
}
2323
else if (type == typeof(int))
2424
{
25-
PlayerPrefs.SetInt(key, (int) state);
25+
PlayerPrefs.SetInt(key, (int)state);
2626
}
2727
else if (type == typeof(float))
2828
{
29-
PlayerPrefs.SetFloat(key, (float) state);
29+
PlayerPrefs.SetFloat(key, (float)state);
30+
}
31+
else if (type == typeof(bool))
32+
{
33+
PlayerPrefs.SetInt(key, (bool)state ? 1 : 0);
3034
}
3135
else
3236
{

package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
{
22
"name": "com.depra.persistent.unity",
3-
"version": "0.0.4",
3+
"version": "0.0.5-pre.1",
44
"displayName": "Depra.Persistent",
55
"description": "Depra.Persistent module integration for Unity Engine.",
66
"unity": "2021.3",
77
"license": "Apache-2.0",
88
"keywords": [
9-
"save",
10-
"load",
119
"unity",
1210
"persistent"
1311
],
1412
"author": {
1513
"name": "Depra, Inc.",
1614
"email": "[email protected]",
17-
"url": "https://github.com/Depression-aggression"
15+
"url": "https://github.com/Depra-Inc"
1816
},
1917
"repository": {
2018
"type": "git",

0 commit comments

Comments
 (0)