Hi
I’m trying use guitexures as toggle buttons changing their color make them bright and dull when on or off respectively. I’m doing this based on their current color but I can’t get the code to fire and I think the if statement is the problem when it checks for the current color.
here is my code:
Color onColor = new Color(128,128,128,128);
Color offColor = new Color(50,50,50,128);
for(int i=0; i < Checks.Count; i++)
{
//Loop for all the toggle buttons
if(Checks*.HitTest(hitPos))*
-
{*
-
//Turn on track when dull*
_ if(Checks*.color == offColor && !pressed)_
_ {_
_ Debug.Log(“on”);_
_ pressed = true;_
_ Checks.color = onColor;
Tracks.active = true;
}
//Turn off track when bright*
if(Checks*.color == onColor && !pressed)
{
pressed = true;
Debug.Log(“off”);
Checks.color = offColor;
Tracks.active= false;
}
}*
The code doesn’t seems to fire for some reason._