(Unity 4.6) Using Buttons with both Sprite Swap and Animation transition

Is there a way for Buttons in uGUI (Unity 4.6) to have a transition that uses both Sprite Swap and Animation?

We have a generic animator for all buttons in our game, which scales and tints them all in the same way, depending on state (pressed, highlighted, etc). We use the “Animation” transition (and this animator) in all of them.

However, we also want buttons to have a different Sprite for the pressed/disabled/highlighted states, but if we set the transition to “Sprite Swap” we lose the ability to use our animator.

Creating a new animator for each button is out of the question. Is there a native way to do this? We could create a script that detects OnPointerDown/OnPointerUp for the pressed state, but that would leave out the disabled and highlighted states (the latter of which is used both via hovering and keyboard-selecting, I believe).

We are using Unity 4.6.0b21.

Update: I proposed the feature in Unity Feedback, here. For anybody reading this, vote if you’re interested. Thanks.

Update 2: I added code for a custom class to do this in my related Unity forum post. It’s far from perfect, so I’m waiting for someone else to come up with a better solution. That is the reason I have not accepted any answer yet, or posted my solution as one.

Add another script to your button prefab to change the sprite for you. Then have your generic animation use animationevents to tell this script when to update the sprite. This is why I love the component model – you can usually get around a problem by adding a small script.