Alternative method to hide the Action UI Buttons

Hello all,

As a massive fan of the XCOM franchise, I wanted to emulate that game’s method of hiding the Action UI buttons themselves when performing an action rather than showing/hiding a separate UI element on top of them.

I added the code from the ActionBusyUI.cs script directly into UnitActionSystemUI.cs script instead and modified the order of the UnitActionSystem_OnBusyChanged() as detailed below.

I Hope this helps somebody who wanted something similar.

10 Likes

Yup that’s a nice simple addition, good job!

2 Likes

Another alternative to this alternative, same function but tighter code!

2 Likes

Another alternative to the alternative to the alternative!

I wanted my buttons to become transparent, because I thought it would look nice, and I discovered the built in handling unity has for this. If you set the disabled colour field to a very low alpha:

image

Then when you make the button non-interactible it automatically changes it to the “Disabled Color”, making it transparent. Then to clean up you just have to make the text transparent, and done:

2 Likes

Very nice! There are a lot of great ways to show players what actions are available and not. I like transparent buttons.

1 Like

Thanks for inspire me and I slightly change the code that dont need to create the Transform list

and the Hide function is in the ActionButtonUI class just to let itself control the HideOrShow logic as CM always do

2 Likes

Privacy & Terms