dimanche 24 novembre 2019

Is it possible to test an entire array at once?

Is there a way to use an if statement to test an entire array at once by doing something like this:

if(myArray == {1,2,3})
{Debug.Log("This is quick")}

or do I need to iterate through each value in the array like this:

if(myArray[0] == 1 && myArray[1] == 2 && myArray[2] == 3)
{Debug.Log("This is not as quick")}

Aucun commentaire:

Enregistrer un commentaire