How to keep a button in pressed state?
I have 3 canvases if we click 1st button in 1st canvas it will display 2nd canvas buttons..then 1st button in pressed state..i pressed a button in 2nd canvas will display 3rd canvas information but in that only 2nd canvas button is in pressed state i want 1st canvas button also in pressed state
Answer by Anjamma · Apr 10, 2017 at 11:53 AM
public Canvas canvas; public Canvas cash; public Canvas tournaments; public Canvas practice; public Canvas pointsrummycanvas; public Canvas poolrummycanvas; public Canvas dealsrummycanvas; public Canvas pointsrummycanvas1; public Canvas poolrummycanvas1; public Canvas dealsrummycanvas1; public Button cashbutton; public Button tournamentsbutton; public Button practicebutton; public void Onclick() { cash.gameObject.SetActive(true); tournaments.gameObject.SetActive(false); practice.gameObject.SetActive(false);
}
public void Onclick1()
{
cash.gameObject.SetActive(false);
tournaments.gameObject.SetActive(true);
practice.gameObject.SetActive(false);
}
public void Onclick2()
{
cash.gameObject.SetActive(false);
tournaments.gameObject.SetActive(false);
practice.gameObject.SetActive(true);
}
public void Onclick3()
{
poolrummycanvas.gameObject.SetActive(false);
pointsrummycanvas.gameObject.SetActive(true);
dealsrummycanvas.gameObject.SetActive(false);
cashbutton.Select();
}
public void onclick4()
{
canvas.gameObject.SetActive(true);
pointsrummycanvas.gameObject.SetActive(false);
poolrummycanvas.gameObject.SetActive(true);
}
public void Onclick5()
{
pointsrummycanvas.gameObject.SetActive(false);
poolrummycanvas.gameObject.SetActive(false);
dealsrummycanvas.gameObject.SetActive(true);
}
public void Onclick6()
{
pointsrummycanvas1.gameObject.SetActive(true);
poolrummycanvas1.gameObject.SetActive(false);
dealsrummycanvas1.gameObject.SetActive(false);
}
public void Onclick7()
{
pointsrummycanvas1.gameObject.SetActive(false);
poolrummycanvas1.gameObject.SetActive(true);
dealsrummycanvas1.gameObject.SetActive(false);
}
public void Onclick8()
{
pointsrummycanvas1.gameObject.SetActive(false);
poolrummycanvas1.gameObject.SetActive(false);
dealsrummycanvas1.gameObject.SetActive(true);
}
}