// OnStateExit is called before OnStateExit is called on any state inside this state machine
 public override void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 {
     if (sendTo == Option.selfOnly)
         animator.SendMessage(messageName, _require);
     else if (sendTo == Option.selfAndParent) {
         animator.SendMessage(messageName, _require);
         if (animator.transform.parent)
             animator.transform.parent.SendMessage(messageName, _require);
     } else if (sendTo == Option.parentOnly) {
         if (animator.transform.parent)
             animator.transform.parent.SendMessage(messageName, _require);
     } else if (sendTo == Option.upwards)
         animator.SendMessageUpwards(messageName, _require);
 }
 public override void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 {
     if (stateInfo.normalizedTime >= 1)
     {
         string message = transitionIn? "TransitionedIn" : "TransitionedOut";
         animator.SendMessage(message);
     }
 }
 // OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
 public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 {
     animator.SendMessage ("StartRecording",SendMessageOptions.DontRequireReceiver);
 }
 // OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks
 public override void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 {
     animator.SendMessage ("Record",SendMessageOptions.DontRequireReceiver);
 }