Question by
Brylos · Dec 02, 2016 at 02:11 AM ·
uieventsystem
UI button not highlighting correctly
Hi there. I have a button that opens up a panel that acts as a server browser. I have it set so when you open it, the selected game object selects the refresh button. For some reason though, whenever I first open the menu, it doesn't switch from the normal color to the highlighted color. If I select the X button that I have next to it, then move back to the refresh button, it switches properly. I believe it has to do with the object being disabled, then when I open the menu it becomes enabled but still doesn't highlight it.
This is the code I have for that panel
if (JoinGamePanelOpen)
{
JoinGamePanel.transform.localScale = new Vector3(0.4279618f, 0.4279618f, 0.4279618f);
RefreshButton.enabled = true;
JoinCloseButton.enabled = true;
}
else
{
JoinGamePanel.transform.localScale = new Vector3(0, 0, 0);
RefreshButton.enabled = false;
JoinCloseButton.enabled = false;
}
Anyone that can help?
Comment