How do I compare a gameobject's name to all strings in an arraylist [UnityScript]
I've created an ArrayList here:
var al = new Array( [ "ground1", "testbox" ] );
Debug.Log(al);
I have a second part that I want to detect to see if the current gameObject's name matches any of the strings in the ArrayList. I don't know how to make it do that, though:
if(gameObject.name == al){
Debug.Log("success");
}
This is just a test to get this concept working. I've looked elsewhere & can't seem to find anyone asking this same question. Any help would be appreciated ^-^
Comment
Your answer
Follow this Question
Related Questions
int array examples not helping very much 0 Answers
Putting a Gameobject in an Array after spawning it 0 Answers
Z-Index | Organise Int Array - Sequence 1 Answer
I Need Help Setting Up a Torch Mechanic (Pls Read Desc) 0 Answers
Show and Hide 3D Objects Array by Clicking Button Over and Over 0 Answers