Size: a a a

2020 May 18

d

dm in unity3d.ru
It's not clear from your code why there's a lot of conversions. Start with a simple version
источник

TK

T K in unity3d.ru
Wajid Ali
I haven't
He might be right. “Set” function is not mentioned to actually save any values before app closes, so you have to use playerprefs.save to do that manually during runtime
источник

W

Wajid Ali in unity3d.ru
T K
He might be right. “Set” function is not mentioned to actually save any values before app closes, so you have to use playerprefs.save to do that manually during runtime
I did that too
источник

W

Wajid Ali in unity3d.ru
источник

W

Wajid Ali in unity3d.ru
I called the PlayerPrefs.Save in the SaveDatabase function but still it is not working.
источник

d

dm in unity3d.ru
SaveDatabase looks right
источник

W

Wajid Ali in unity3d.ru
dm
SaveDatabase looks right
Let me simplify the code for you
источник

W

Wajid Ali in unity3d.ru
Do this make more sense now ?
источник

d

dm in unity3d.ru
text = PlayerPrefs.GetString(gameDataKey, JsonUtility.ToJson(...))
источник

d

dm in unity3d.ru
why? if you have key and want read from it
источник

d

dm in unity3d.ru
you must read string and restore data FromJson
источник

W

Wajid Ali in unity3d.ru
dm
you must read string and restore data FromJson
I did that. Didn't i ? in the If statement
источник

d

dm in unity3d.ru
ok. what you see in console (logs)?
источник

W

Wajid Ali in unity3d.ru
dm
ok. what you see in console (logs)?
источник

W

Wajid Ali in unity3d.ru
the data is being saved by now let me reload the game and see the logs again
источник

W

Wajid Ali in unity3d.ru
starts from 0
источник

TK

T K in unity3d.ru
My guess is that at the begining of loading part you are setting jsonString to empty and then trying to load FromJson<Database> with this empty value
источник

W

Wajid Ali in unity3d.ru
T K
My guess is that at the begining of loading part you are setting jsonString to empty and then trying to load FromJson<Database> with this empty value
The Else statement is executing all the time for now
источник

TK

T K in unity3d.ru
And else is only setting prefs, not getting it
источник

W

Wajid Ali in unity3d.ru
T K
My guess is that at the begining of loading part you are setting jsonString to empty and then trying to load FromJson<Database> with this empty value
In the else statement I am calling the default configurations to be set. (For First Time run)
источник