Alternative

Just by playing around I wanted to change the color of my button instead of using a sprite.

Not because I was lazy…

So in my button ui script:

    public void SetActiveUI()
    {
        button.image.color = new Color32(243, 97, 97, 255);
    }

    public void ResetActiveUI()
    {
        button.image.color = new Color32(0, 0, 0, 255);
    }

And I would use these in my UnitActionSystemUI to toggle which one’s active.

It was neat to learn about Color() and Color32() and how you can use these;

3 Likes

Simple changes of color can make excellent UI changes. The real beauty of Color32 is that you can also make semi-transparent colors, which I personally find excellent for inactive buttons.

2 Likes

You are very right, the typical grey out with a dim opacity it’s really intuitive for user experience when it comes to showing inability to use that item/ability/action

Privacy & Terms