2

I am using Unity 5 on iMAC. I have faced strange but true unknown issue with player prefs.

Issue :

On Unity Editor - I have stored integer value in player prefs that works fine in UnityEditor, and when i restart my game in unityEditor then It was saved and i can retrieve that older saved player prefs's value.

On Android/iOS Device - I have run that same code with device then behaviour will changed.During running game player prefs works fine and i can set and get that value. But when i restart the game then i lost that value and can't retrieve that saved value another time.

I am tired to solve that issue, but i can't get success.

Anyone know solution about this unknowing behaviour of player prefs ?

Thank you in advance.

4

2 に答える 2

3

データ入れてから使うPlayerPrefs.Save()

それについて読んでいない場合http://docs.unity3d.com/ScriptReference/PlayerPrefs.Save.html

于 2015-06-16T14:13:57.060 に答える
0

独自のファイル/シリアル化ソリューションを使用して、これを回避できます。たとえば、protobuf です。ここで優れたガイドを読むことができます。

于 2015-06-24T16:12:02.703 に答える