title: How to check if a certain animation state from an animator is running?
body: <p>I created an animator called "m4a4animator". Inside it, the main function is called "idle" (nothing), and other 2 states: "shoot" (mouse0) and "reload" (R). These 2 animation states are transitioned to "idle". Now, everything is working... but the only problem I have is this: if I am in the middle of reloading and and press mouse0 (shoot), the animation running state immediately changes to shoot... but I want to block that.</p>
  
  <p>Now, the question: How can I stop CERTAIN animation changes while an animation is running?</p>
  
  <p><a href="https://i.stack.imgur.com/ZWt4A.png" rel="nofollow noreferrer">Here is my animator</a></p>
  
  <p>And here is my script:</p>
  
  <pre><code>using UnityEngine;
  using System.Collections;
  
  public class m4a4 : MonoBehaviour {
  
      public Animator m4a4animator;
  
      // Use this for initialization
      void Start () {
  
      }
  
      // Update is called once per frame
      void Update () {
          if (Input.GetKeyDown (KeyCode.R)) {
  
              m4a4animator.Play("reload");
  
          }
  
          if (Input.GetMouseButton(0)) {
  
              m4a4animator.Play("shoot");
  
          }
      }
  }
  </code></pre>