with no Additional Details , this is my code
void OnGUI()
{
if (ShopGui) firstInv();
if (secondGUI) secondInv();
}
void firstInv()
{
print(ShopGui);
if(ShopGui)
{
GUI.BeginGroup(new Rect(0, 0, Screen.width, Screen.height), "");
int i = 0;
for (int X = 0; X < 3; X++)
{
for (int Y = 0; Y < 3; Y++)
{
Rect slotRect = new Rect(X * ((Screen.width / 4) + 10), Y * ((Screen.width / 4) + 10), Screen.width / 4, Screen.width / 4);
if(GUI.Button(slotRect, ""))
{
Debug.Log("Clicked the button with an image");
ShopGui = false;
secondGUI = true;
}
menuSecond _= menuFirst*;*_
GUI.DrawTexture(slotRect, menuSecond*.view);*
i++;
}
}
GUI.EndGroup();
}
}
void secondInv()
{
if(secondGUI)
{
if( GUI.Button(new Rect(50, 50, 100, 100), “SecondInv”))
{
ShopGui = true;
secondGUI = false;
}
}
}
but something strange happens , the 1st time i click on a gui .button both of my gui menus appear on screen and the shopgui boolan is both true and false…but the next times this problems goes away…
would anybody tell me why this happens