Saving and loading

Data persistence between sessions

PlayerPrefs

  • Script Reference: PlayerPrefs
  • You can store ints, floats or strings in PlayerPrefs
    • ...which are stored in the Registry :D
    • Not preferred for save files!!!
    • More suitable for saving game preferences
  • Set value with PlayerPrefs.SetInt(intValue)
  • Clear saved data with Edit > Clear All PlayerPrefs

Serializing data to/from JSON

https://twitter.com/daisyowl/status/1620215845954912256?t=mNQx17OSVFs6PdwnkgZ3nQ&s=19