In the animation tab, events can be added at certain points in each animation. During that event, a method can be called on the related script. This can be used to handle a state machine and toggle animations far simpler than just keeping track of numbers and frames to make sure everything is working.