Disable Buttons After AP Zero

I want to make it that the action buttons are disabled after the player is out of points, but because we make the buttons when the scene is instantiated, I am not sure how to do that.

In ActionButtonUI, get a reference to the Unit, and then in the UpdateSelectedVisual, test to see if there are enough action points available for that action. If there aren’t, set the button’s enabled to false.

2 Likes

This worked. I also added UpdateSelectedVisual() to private void UnitActionSystem_OnActionStarted in UnitActionSystemUI so that it would update after using it and not only when a button is clicked again.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms