Select Multiple buttons

I have a TurnOrder UI that I made out of the same buttons. Works pretty well when my units attack is hovering overtop an enemies hex, its selects the units UI up top. The problem is when multiple units are in the attack path. Only the last button is selected. I have a list of units in said pattern but UI is hard

What buttons are you referring to? The ones up top or the ones with actions “Attack”?
What do you mean by “last button is selected”? Do you mean the “Sword” button is always selected, even if you click on the “Move” action?

Sorry for not explaining enough. I’m using the same buttons made made in to course(ActionButtonUI) and put them in the turn order list(TurnOrderButtonUI, Top UI colors/shapes). The buttons are only be able to be selected one at a time because when one is selected the other is deselected. Is there a way to select multiple buttons if I have a list of what buttons to select?
My testing shows when UpdateSelectedVisual() in (TurnOrderButtonUI) is took out, All UI will be selected at start(you can do the same with ActionButtonUI), so I think its possible to select multiple buttons. I’m not sure if how to control multiple buttons that are aren’t selected.

So up top you have buttons for all the actions like Move and Attack?
And you want to select multiple actions at once? You want to Move and Attack at the same time?

The buttons have OnClick listeners, so you know when the player clicks on them

If you want to select multiple then you need a very different architecture from the one in the course. The code in the course assumes you only select one action at a time so when you select a second action it automatically deselects the previous one.

You want to listen to OnClick and add that button to some kind of selectedActionList, then if clicking again you maybe want to remove it from that list.
But then after that I’m not sure how you are intending to execute multiple selected actions at the same time.

Privacy & Terms