News: Enjoy our Christmas offer 30% off on our latest package Tower Defense Level Kit http://u3d.as/m7h

  • August 18, 2018, 04:42:00 AM

Login with username, password and session length

Author Topic: Separating event types / locking on a single event type (until completion)  (Read 524 times)

Offline scornflake

  • Newbie
  • *
  • Posts: 1
I'm using EasyTouch event handlers, i.e:

Code: [Select]
            EasyTouch.On_Swipe2Fingers += EasyTouchOnOnSwipe2Fingers;
            EasyTouch.On_Pinch += EasyTouchOnOnPinch;
            EasyTouch.On_TouchUp += EasyTouchOnOnTouchUp;

However I see multiple types of events. If I pinch, I also see a few swipe events. If I don't release my fingers and then swipe, I receive primarily swipe events (but sometimes pinch, occasionally, especially when the fingers stop moving on the device). Is there a simple way to have EasyTouch detect the primary motion, and only send those events until the number of touches changes?  Or is this something I have to code myself?

p.s.: Using a method similar to what is in RTS_NewSyntaxe, I see similar results.

Here's an example, using Unity Remote. All I did was gently swipe left and right a number of times, with two fingers.
Quote
        void Update()
        {
            Gesture current = EasyTouch.current;
            if (current == null)
            {
                return;
            }

            Debug.Log("Type: " + current.type);
        }
https://www.dropbox.com/s/y846h6g6fowja52/SimpleTouchExample.mp4?dl=0

Pic of settings (couldn't get attachments to work here)
https://www.dropbox.com/s/zcdzdoj4nwbtnfg/EasyTouchSettings.png?dl=0
« Last Edit: May 10, 2017, 08:14:50 AM by scornflake »

Offline Nicolas

  • Administrator
  • Hero Member
  • *****
  • Posts: 792
Hi,

EasyTouch always send all event for each finger. If you have to manage single gesture and multi fingure gesture, you just have to test the parameter touchcount