I am currently working on a menu in the game. The intention is to go back to the previous screen in the menu. the problem is that I when I push the button go back to the main menu of the game while I do not want it. below I have a small example.
Hope someone can solve this problem soon … thnx
/---------Example --------/
void MoveList()
{
menu = menuskin.GetStyle("Movelist"+movelistnr).normal.background;
if(GUI.Button(new Rect(140,0,100,100), "", menuskin.GetStyle("Arrow_Left")))
if(movelistnr == 1)
movelistnr = 2;
else
movelistnr = 1;
if(GUI.Button(new Rect(720,0,100,100), "", menuskin.GetStyle("Arrow_Right")))
if(movelistnr == 1)
movelistnr = 2;
else
movelistnr = 1;
foreach (Touch touch in Input.touches)
{
if (hitboxes_movelist[0].HitTest(touch.position) && touch.phase == TouchPhase.Stationary)//Back
state = MenuState.Main;
}
}