I have a Panel that contains a set of widgets, on this GO I have a script and in Start() it gets all the buttons I have in a list and sets them to btn.isEnabled = true or false depending on some criteria.
Problem is the buttons are accurately changing to isEnabled state, but the ones that should be isEnabled = false are not changing to their "Disabled Color" from what it seems. The collider appears accurately removed and there is no Hover, so the state is changed but not the sprite.
Any help is appreciated. I tried moving this script to Awake() Start() OnEnabled() with no luck:
public void EnableDepositButtons() {
foreach(UIButton btn in _depositButton) {
if(GameManager.Instance.playerData["Player"].lairGold >= (int) btn.gameObject.GetComponent<PlatinumCoinButton>()._betAmount) {
btn.isEnabled = true;
}
else {
btn.isEnabled = false;
}
}
}
If I hit my UI button that closes and re-opens the Panel that all these buttons are under they accurately show up disabled, it's only the initial opening of the window causing the problem. The button does a simple window.SetActive(false) or true to the entire Panel and hierarchy.