Hi,
I’m having a little bit of trouble trying to create category GUI buttons. Each GUI has its own script in it. In this case I’ll talk about CAT200 and CAT400. I want each CAT to be clickable and once clicked have a GUI texture overlap each GUI button. My CAT200 is working flawless, however when I click on CAT400 the texture overlaps but the CAT200 is not being overlapped, meaning, it’s still showing.
Each gameobject has the same code below. Except the coordinates are of course different from each other
var showMoreGui = false;
var icon : Texture2D;
var next : Texture2D;
var exit : Texture2D;
var Question : Texture2D;
var Answer : Texture2D;
var menuNumber = 0;
function OnGUI()
{
switch(menuNumber)
{
case 0:
icon200();
break;
case 1:
question200();
break;
case 2:
answer200();
break;
case 3:
delete200();
break;
}
}
function icon200()
{
if (GUI.Button (Rect (100,270, 150,100), icon))
menuNumber = 1;
}
function question200 ()
{
(GUI.DrawTexture (Rect (100,10, 1050,750), Question));
if (GUI.Button (Rect (1150,10, 150,100), next))
menuNumber = 2;
if (GUI.Button (Rect (1150,110, 150,100), exit))
menuNumber = 0;
}
function answer200()
{
(GUI.DrawTexture (Rect (100,10, 1050,750), Answer));
if (GUI.Button (Rect (1150,110, 150,100), exit))
menuNumber = 3;
}
function delete200()
{
enabled = false;
}