How can i use PlayerPrefs to save my game? Is there any tutorial available out there (JavaScript) ? If not, can someone give me an example on how to use it?
Here is a piece of my code:
Unlocking level code:
static var level2unlock : boolean;
var level2 : UIButton;
function Update () {
if(!level2unlock)
{
level2.controlIsEnabled = false;
}
else
{
level2.controlIsEnabled = true;
}
}
Code used in level 1. If a condition is met, unlock level 2.
if (transform.position.y > 47)
{
levelunlock.level2unlock = true;
}
I know that i must use PlayerPrefsX to save this kind of information, but i haven't used PlayerPrefs before so i still have no idea. Anyone can help me?