Part of the Unity API, PlayerPrefs, makes it really easy to save and restore data. What might it be used for?
For example, if the player chooses to play Level 2, how do you pass that “2” along to the next scene? One way would be with PlayerPrefs.
When the player passes a checkpoint, how do you save that info so you can start them again at that point the next time they play your game? PlayerPrefs can handle that.
PlayerPrefs: The Basics
This video will show the basics of using PlayerPrefs to save and load (integer) score data.
PlayerPrefs: Handling Vector3 Data
This video will show you how to save and load Vector2 and Vector3 data using Unity’s PlayerPrefs API.
PlayerPrefs: Booleans and Stuff
PlayerPrefs in Unity can’t save boolean values, but you can easily make a couple helper functions that will do the job for you. This video shows how to do that as well as mentions a couple other things that will help you make better use of PlayerPrefs.
If you liked the videos and would like to throw a buck or two my way to show your appreciation, thank you. If you liked the videos but are completely broke, I get that — maybe tweet or post about this page in exchange.