UI Animation - Set values via variables

Hey,

I’m looking for a possibility to set the values of an UI animation via variables.

For example, this color change here:

I want to set the variables once in the application (for example via a scriptable object) and then re-use it in multiple animations.
The goal is, to have UI controls like buttons, dropdown and Co in the same look and feel - but not “hard coded” in the animations. If I want for example play around with the “highlight color”, I need to update all control animations manually.

The only thing I can think about: Manually code it - but I’m not sure how this will work for the controls. Currently, I’m using transition: Animation

I am grateful for any help!

I think values in an Animation would only be fixed, eg, authored in advance as constants.

If you have a quantity you want to assert (such as a particular runtime-generated color), you would need to shove that into the animation asset to make it work, which would be awkward hacky code.

It might be best to just implement the various IPointer*** interfaces to do exactly what you want:

You might be able to combine the Animation method with your own functionality, as long as you disable (X) Write Defaults in the various Animator states so that the colors don’t get wiped out.

Thanks for the feedback!
Then I need to look into something custom build with IPointerXYZ