Hi,
I have an interface with various buttons.
Each button has a script attached which basically draws information when you press it.
For example , if I press button one - a texture will draw and some labels.
Now my problem is - if I press button one , then press button two. The information and textures from button one stay there.
When I push another button , I want the previous button to basically become false.
void OnGUI() {
//make button using btntexture and my style
myGuiStyle_label.normal.textColor = new Color(0.2f,0.6f,0.2f,alphaValue);
GUI.DrawTexture(new Rect(520, 300, 75, 45), btnTexture_ENT, ScaleMode.StretchToFill, true, 10.0F);
// when the button is pressed , init the code or display
GUI.color = new Color(1.0f,1.0f,1.0f,1.0f);
if (GUI.Button(new Rect(450, 187, 75, 50), btnTexture,myGuiStyle))
{
press = true; // makes state = true , start the true code
//StopOtherScript = Buttons.Find("Button_1").GetComponent<Buttons>();
}
if(press == true)
{
//print things
//draw textures
// functions
}
{
Each of my buttons is a gameobject with a similar script attached.
Thanks