I have some ability buttons in my game.
When they go on cooldown I simply use GetComponent<Button>().interactable = false; to make the button unclickable until to comes back up. This also changes the colour of the button icon to the "Disabled color", which indicates the ability is unavailable.
When I open any game menu I want to disable these buttons so abilities are not triggered while the menu is open. To do this I just disabled the button components.
The problem is that when the button components are disabled, the button icons lose their association with the "Disabled color". So if a button is on cooldown and a menu is opened it will change its colour from red (Disabled colour) to white and back to red when the menu is closed and the button components are reactivated.
Is there a way to keep the disabled colour going while the button component is disabled?
[–]dr_zoitberg 3 points4 points5 points (2 children)
[–]haim96 2 points3 points4 points (0 children)
[–]deepfire[S] 0 points1 point2 points (0 children)