Ejemplo n.º 1
0
 private void EndTracking(TouchTracker a_Tracker, int remove_at)
 {
     if (EventTouchEnded != null)
     {
         EventTouchEnded(a_Tracker);
     }
     m_Trackers.RemoveAt(remove_at);
     m_TrackerLookup.Remove(a_Tracker.GetFingerID());
 }
Ejemplo n.º 2
0
        // Mouse Touch Input
        private void BeginTracking(Vector2 a_ScreenPos)
        {
            TouchTracker tracker = new TouchTracker(a_ScreenPos);

            m_Trackers.Add(tracker);
            m_TrackerLookup[0] = tracker;
            if (EventTouchBegan != null)
            {
                EventTouchBegan(tracker);
            }
        }
Ejemplo n.º 3
0
        private void BeginTracking(Touch a_Touch)
        {
            TouchTracker tracker = new TouchTracker(a_Touch);

            m_Trackers.Add(tracker);
            m_TrackerLookup[a_Touch.fingerId] = tracker;
            if (EventTouchBegan != null)
            {
                EventTouchBegan(tracker);
            }
        }
Ejemplo n.º 4
0
        //-------

        private void OnTouchBegan(TouchTracker touch)
        {
            if (!_active)
            {
                return;
            }

            if (DidCollide(touch.GetCurrPosition()) && _active_touch < 0)
            {
                _active_touch = touch.GetFingerID();
                if (EventPress != null)
                {
                    EventPress(touch);
                }
            }
        }
Ejemplo n.º 5
0
 private void OnTouchUpdate(TouchTracker touch)
 {
     if (!_active)
     {
         return;
     }
     if (_active_touch >= 0 && _active_touch == touch.GetFingerID())
     {
         if (touch.DeltaPosition().magnitude > 0f)
         {
             if (EventDrag != null)
             {
                 EventDrag(touch);
             }
         }
     }
 }
Ejemplo n.º 6
0
 private void OnTouchEnded(TouchTracker touch)
 {
     if (!_active)
     {
         return;
     }
     if (_active_touch >= 0 && _active_touch == touch.GetFingerID())
     {
         if (DidCollide(touch.GetCurrPosition()))
         {
             if (EventRelease != null)
             {
                 EventRelease(touch);
             }
         }
         CancelTouch();
     }
 }
Ejemplo n.º 7
0
        private void OnTouchUpdateAll(BetterList <TouchTracker> a_Touches)
        {
            m_Triggered = false;
            for (int i = 0; i < a_Touches.size; ++i)
            {
                if (IsInside(a_Touches[i].GetCurrPosition()))
                {
                    m_TouchScreenPos = a_Touches[i].GetCurrPosition();
                    m_Triggered      = true;
                    _ActiveTracker   = a_Touches[i];
                }
            }

            if (EventTestTouch != null)
            {
                EventTestTouch(m_Triggered);
            }

            if (m_Triggered && EventTouched != null)
            {
                EventTouched(this);
            }
        }