Hello guys, I need to set game options using PlayerPrefs but i don’t know how to write if statements. I wrote an example code
#pragma strict
var playTypeString : String;
function Update () {
var text = gameObject.GetComponent(TextMesh);
text.text = playTypeString.ToString();
if(PlayerPrefs.GetString(playerType,"sphere")){
playTypeString = "sphere";
}
if(PlayerPrefs.GetString(playerType,"stick")){
playTypeString = "stick";
}
if(PlayerPrefs.GetString(playerType,"plus")){
playTypeString = "plus";
}
}
But as i said i got syntax error. What can i do ?