- Home /
Question by
basavaraj_guled · Feb 05, 2016 at 05:02 AM ·
jsonutilityprefs
Using JsonUtility
Can anyone explain how can i use jsonUtility to save PlayerPrefs and get the PlayerPrefs for the same
Comment
Answer by superpig · Feb 09, 2016 at 12:59 PM
Saving: Use JsonUtility.ToJson() to convert a class or struct containing your save data into a string, and then use PlayerPrefs.SetString() to save that JSON string into PlayerPrefs.
Loading: Use PlayerPrefs.GetString() to get the JSON string from PlayerPrefs, then JsonUtility.FromJson() to turn it back into your class or struct.