Run the Transition of a UI Button from Script?

I have a Color Tint transition on a UI Button. It’s the default thing that comes built-in with Unity.

How do I run that from script?

(Trying to achieve the effect of a flashing button to get player’s attention, but I want to use the normalColor and highlightColor already chosen in the inspector.)

EDIT: So you can apparetly fake it like this…

b.image.CrossFadeColor(b.colors.normalColor, b.colors.fadeDuration, true, true);
1 Like

Your edit is correct: the transition of unity actually uses this function for the color tint.

1 Like