- Home /
Question by
programmrzinc · Jan 24, 2012 at 02:34 AM ·
levelsavingfilesfilesystem
Saving Level data to a file
I want to save the level number, so i can read it again later when the person plays the game later again. is there a way to do this in unity?
Comment
Best Answer
Answer by syclamoth · Jan 24, 2012 at 02:35 AM
For very simple stuff like this, use
PlayerPrefs.SetInt("CurrentLevel", [level number here]);
And then when you go to load the level, use
Application.LoadLevel(PlayerPrefs.GetInt("CurrentLevel"));
This stores data in the registry on windows, and ~/Library/Preferences on $$anonymous$$acOS.