Hi again.
I have setup a Toggle in UnityUI with sprite swap transition and hooked it up to an AC menu. In AC I also defined an alternative input button for the toggle. I also made sure that in AC the keyboard input only calls this one toggle and nothing else.
When I click the toggle, everything works as intended. When I use the keyboard input everything but the sprite swap works.
I'm trying all this without writing any additional code, maybe it just doesn't work like this. Maybe I'm just missing a checkbox somewhere (there are a lot of those)!
Thanks again for any help!
Comments
The value the Toggle is linked to will change, and the Toggle itself will update with the new checked state, but as the Toggle itself hasn't been clicked it won't play any Transition animation.
AKAIK the transition behaviour is limited to clicking on the element directly, as it's all Unity internal. You could try animating it by attaching an Animator component and then running that animation at the same time as the input button is pressed.
You can make use of the OnMenuElementClick event to run code that triggers the animator when the element is invoked - this will run even when done through the alternative input button.
A tutorial on custom events can be found here, while an example of the above event can be found in the "Custom interaction systems" chapter of the Manual.
I don't intend to use this for more than a handful of slots at a time, so hardcoding "turn all the others off, when this one is clicked" into an action list is still okay. Sprite swapping is quite easy with manually toggling AC Menu Graphic elemets.