Hi,
I have two buttons in my scene. One with the following code…
function OnGUI () {
if (GUI.Button (Rect (100,400,50,30), "Click")) {
PlayerPrefs.SetString("MyString", "4");
}
}
and the other with…
function OnGUI () {
if (GUI.Button (Rect (100,600,50,30), "Click")) {
var test : String = PlayerPrefs.GetString("MyString");
if (test == 4 ){
print ("It's true, it's 4");
}
}
}
Why won’t it print?