I am needing to use the TextureMap.GetPixel() in a switch and case statement. There are several specific colors that the ray will definitely hit which is why I am trying to use a switch case statement. The several colors that will be hit are Color(0.925,0.942,1.000,1.000) and Color(0.000,0.941,1.000,1.000) for example. I have tryed
var color = Color(0.925,0.942,1.000,1.000)
switch(TextureMap.GetPixel (pixelUV.x,pixelUV.y)){
case color:
print("This is southland");
break;
}
//also doesn't work
if(TextureMap.GetPixel (pixelUV.x,pixelUV.y) == color){
print("This is southland");
}
But this doesn’t work even if when both color and getPixel() are printed and they are exactly the same. Also doesn’t work in if statements. Can anyone see anything that is wrong with the code?