- Home /
Question by
devganajay61 · Jan 20, 2021 at 03:09 PM ·
unity 5unity 2d
I want to disable button and re-enable button after click
I am working on simple random number generator functionality there is three button a, b and c . if i click button "a" then generate number and it disable after click then if i click "b" it show some random image then it disable. last when i click button "c" then it will default the value of "a" and "b" and re-enable both button how can i do that please help !
Comment
Best Answer
Answer by logicandchaos · Jan 20, 2021 at 03:22 PM
public Button a;
public Button b;
public Button c;
public void PressButtonA()
{
a.interactable = false;
}
public void PressButtonB()
{
b.interactable = false;
}
public void PressButtonC()
{
a.interactable = true;
b.interactable = true;
}