Quantcast
Channel: Questions in topic: "playerprefs"
Viewing all articles
Browse latest Browse all 1333

If Statements with PlayerPrefs

$
0
0
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 ?

Viewing all articles
Browse latest Browse all 1333

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>