- Home /
Question by
antoniomiguelferreiraaires · May 14, 2018 at 02:44 PM ·
uibuttonscript.
Activate only one button color
Hello I have this silly question. I have 3 buttons and I wan't to only have blue on the one clicked, when I click on one the others stay white. I have this scrift I found around here but it doesn't disable the other 2 buttons when I click on the other one..
public bool ButtonOn = false;
public Button MyButton;
public void BeenClicked()
{
ButtonOn = !ButtonOn;
if (ButtonOn)
{
MyButton.image.color = new Color32(18, 157, 227, 255);
}
else
{
MyButton.image.color = new Color32(212, 212, 212, 255);
}
}
Any tips? Thanks!!
Comment