Hello,
I believe this is a bug. My game plays OK normally, I terminate the app and restart multiple times and it keeps the PlayerPrefs info well. But when I update the app with a newer version, the level value goes 0. Is there a reason why playerPrefs may be getting zeroed? I am using Unity 2020.1.7f1
private void Start() {
if (PlayerPrefs.HasKey(LEVEL)) {
print("Has Key " + PlayerPrefs.GetInt(LEVEL));
} else {
print("No Level Key");
}
level = PlayerPrefs.GetInt(LEVEL, 1);
Debug.Log("Level " + level);
ToggleMenu(MenuSelect.start);
}
And the XCode says:
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
Has Key 0
UIManager:Start()
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
Level 0
UIManager:Start()