Stopping a GUI.Drawtexture?

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

Maybe you should add if statement before DrawTexture?

...
if(press)
    GUI.DrawTexture(new Rect(520, 300, 75, 45), btnTexture_ENT, ScaleMode.StretchToFill, true, 10.0F);
...

That doesnt work? :confused:

In the code shown, I don’t see you ever setting press to false.

Make a var for each button\GUI shown, and say

var 1IsShowing : boolean;
var 2IsShowing : boolean;
var 3IsShowing : boolean; etc…

if(1IsShowing)
{
GUI.DrawTexture(new Rect(520, 300, 75, 45), btnTexture_ENT, ScaleMode.StretchToFill, true, 10.0F);
2IsShowing = false;
3IsShowing = false; etc…
}

Im not an expert im just a begginer but i think that this method should work…sorry if its not, again im just a begginer