Request: I think it would be useful something like:
layer.states.state("default").on "End", -> do something
layer.on Events.StateDidSwitch, -> if layer.states.state == "End" then do something
Check the docs for the events, there is also a StateWillSwitch
and you can also use layer.states.current. it's a same thing with layer.states.state.
Thanks John, as always ;)