Sorry about the name I didn’t know how to explain it in a title.
Im using JavaScript and I want to know how to make it show a picture if the integer is either 1 or 3 so I get.
if (PlayerPrefs.GetInt(“Map Area”)==1)
but how would I make
if (PlayerPrefs.GetInt(“Map Area”)==1) or (PlayerPrefs.GetInt(“Map Area”)==3)
it will show my image instead of just the Int being 1?
Please and thankyou in advance - sorry if it doesn’t really make sense im not that good at explaining.
Use the OR operator in JavaScript which is: ||
So your statement will look like:
if ((PlayerPrefs.GetInt(“Map Area”)==1) || (PlayerPrefs.GetInt(“Map Area”)==3))
Feel free to read up more on conditional operators at:
W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.
if((PlayerPrefs.GetInt("Map Area")==1) || (PlayerPrefs.GetInt("Map Area")==3))
{
// Insert code here
}