title: Mouse up vs. touch up in Unity
body: <p>I have a bit of an issue. I can't seem to find a good way to distinguish whether Unity is firing a mouse up vs. a touch up event. By touch up I mean when the user releases their finger from the screen after touching something on a touch display.</p>
  
  <p>The problem is this: I have an issue with game logic where the user both lets go of something they've selected with their mouse and SIMULTANEOUSLY touches / releases their touch to click a UI button (in other words, I'm trying to detect a mouse release only, or, a touch release only - how can I do that?). I've tried using both <code>Input.GetMouseButtonUp(0)</code> as well as <code>Input.GetMouseButton(0)</code>, but both change their state if its a touch up or a mouse button up event.</p>
  
  <p>So how do you properly distinguish between the two? I even tried using the <code>Touch.fingerId</code> property which works well to track / distinguish ONLY touch events, but, the problem is then that I still cannot distinguish ONLY mouse up with <code>Input.GetMouseButton(0)</code> since it fires even in the event of a touch up.</p>
  
  <p>Does anyone out there happen to know what the proper way would be to detect just a mouse release, or just a touch release, separately, in Unity?</p>
  
  <p><strong>Edit</strong>:</p>
  
  <p>Someone didn't understand the problem at hand, so let's assume for a second you have a desktop device with touch support. Add this script:</p>
  
  <pre><code>void Update () {
      if (Input.GetMouseButtonDown(0))
          Debug.Log("Mouse button down.");
      if (Input.GetMouseButtonUp(0))
          Debug.Log("Mouse button up.");
  }
  </code></pre>
  
  <p>If you click and HOLD with your mouse, while holding, you can touch and release with your finger, which will log <code>Mouse button up.</code>, <strong>despite the fact that you did not release the mouse button</strong>. How can I distinguish between a mouse up vs. a touch release?</p>