Gui.enabled

if(button1 == true)
{
if(GUI.Button(new Rect(Screen.width * (4.25f/6.55f), Screen.height * (1.1f/6.55f),
Screen.width * (0.7f/6.55f), Screen.height * (0.7f/6.3f)),
{
GUI.enabled = false;
}

                               }//button1

                        if(button2 == true)
                               {
     if(GUI.Button(new Rect(Screen.width * (4.25f/6.55f), Screen.height * (1.1f/6.55f), 
		                       Screen.width * (0.7f/6.55f), Screen.height * (0.7f/6.3f)),
                                            {
                                        GUI.enabled = false;
                                            }

                               }//button2

i have ten button which ever button i press should become disabled condition and other button should remain in enabled condition as long as it is not pressed .For example if i press 8 button it alone should become GUI.enabled = false and other button should remain in GUI.enabled = true as long as that button is not pressed if after after 8 th button if i press 7th that should become GUI.enabled how to attain this one through scripting can anybody help as i am new to unity

You basically just want to disable the menu item that’s in use? You could wrap this up into a function or use an enum, etc… but let’s just use a simple example, displaying 3 buttons:

private var activeButton:int = 0;

function OnGUI():void
{
    GUI.enabled = (activeButton!=1);
    if(GUILayout.Button("Button 1")){ activeButton = 1; }

    GUI.enabled = (activeButton!=2);
    if(GUILayout.Button("Button 2")){ activeButton = 2; }

    GUI.enabled = (activeButton!=3);
    if(GUILayout.Button("Button 3")){ activeButton = 3; }

    GUI.enabled = true; //we make the gui enabled again for more code...
}