- Home /
Question by
vasant · Sep 20, 2014 at 04:10 PM ·
javascripttexturearray
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
Comment
Best Answer
Answer by Eric5h5 · Sep 20, 2014 at 04:37 PM
if (System.Array.IndexOf (frames, frame2) != -1)
Your answer
Follow this Question
Related Questions
How can i show the texture in the array? 2 Answers
Applying different textures to spawned objects. 2 Answers
How do I make an array of arrays in javascript 1 Answer
GUI Texture fixed on Object 1 Answer