Compare texture from array to another one in list

Please check the following code:

#pragma strict
var frames : Texture2D;
var frame2 : Texture2D;

function Start () {
if (frames == frame2){
renderer.material.color = Color.green;
}
}

Basically, I want to compare a texture from the array to the texture in frame2. The point is the texture in array could be anywhere in the list. Thanks in advance

1 Answer

1

if (System.Array.IndexOf (frames, frame2) != -1)

Thanks a Lot. You really helped me out.