The easiest way would be to call SetAnimation()
to immediately start "move_animation", immediately followed by calling AddAnimation()
for "idle_animation".
If you really want to use the callback delegate methods, you just have to register to End or Complete of the first animation, as I said earlier.
var trackEntry = animationState.SetAnimation(0, "move_animation", false);
trackEntry.Complete += SwitchToIdleMethod;
I fail to see what would cause problems with the above code.
eko_lx :
If I will subscribe to End event or any other event this routine will run infinitely from first button click.
No, it will not if you register to trackEntry.Complete
or trackEntry.End
.