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

If two PlayerPrefs are on?

$
0
0
So I am having this issue where if I call upon one playerpref it works fine, and if I call upon a different playerpref it also works fine, but if I call upon both of them, it no longer works. I understand what I am saying is confusing, so here is an example: function Update () { if (PlayerPrefs.GetInt("aPP1")==1) { } else if (PlayerPrefs.GetInt("aPP2")==1) { } else if ((PlayerPrefs.GetInt("aPP1")==1) && (PlayerPrefs.GetInt("aPP2")==1)) { } else if ((PlayerPrefs.GetInt("aPP1")==0) && (PlayerPrefs.GetInt("aPP2")==0)) { } } Now the wierd thing is is that when both playerprefs are set to zero, the last else if works just fine. But if they are both set to "1" the second else if does not work and instead only does the first else if. How would I go about fixing this?

Viewing all articles
Browse latest Browse all 1333

Trending Articles