Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Using OnMouseUp() assuming that it will work with touch

Discussion in 'Scripting' started by DaveCole, Sep 15, 2015.

  1. DaveCole

    DaveCole

    Joined:
    Sep 15, 2015
    Posts:
    12
    Hi,

    I have created a game targeting windows 8.1 universal and now windows 10 universal. I have (probably incorrectly used mouse event methods like OnMouseUp() and OnMouseDrag() which until now have worked perfectly well with windows touch devices. With the advent of windows 10, I find that touch still works on windows 8.1 desktops, tablets and phones, but not with the new windows 10 phone emulators. The mouse pointer simulator still works on windows 10 phone emulators. Time for an input re-write?

    Thanks!
    Dave
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,817
    I have a little "MicroTouch" lightweight touch class that takes mouse and touches and bundles them up so you can more or less use the same decision logic code without having to keep two copies of it in sync.

    https://bitbucket.org/kurtdekker/proximity_buttons

    The point of that repository is another UI construct, what I call the "proximity button," but it has my MicroTouch class in it too. Might get you closer to what you're looking for.
     
  3. DaveCole

    DaveCole

    Joined:
    Sep 15, 2015
    Posts:
    12
    Sounds perfect thanks!
     
  4. DaveCole

    DaveCole

    Joined:
    Sep 15, 2015
    Posts:
    12