I’m working on something where I have several UIs that are showing the health of several game objects. On each UI is a health bar and a “repair” button. When the button is clicked, the game object goes into repair mode and replenishes its health.
My question is this. I only want one game object to be repairing at any one time. So when one is repairing, the repair buttons on the rest of the UIs need to be disabled.
Unfortunately, it’s not as simple as just running a for loop, finding the one that is repairing, and disabling the rest. Because if NONE of them are repairing, then none of them should be disabled.
I’ve been trying to wrap my head around this one for a few days now, and can’t figure it out. Can anyone let me know what the best approach is for something like this is?