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()); }
// 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); } }
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); } }
//------- private void OnTouchBegan(TouchTracker touch) { if (!_active) { return; } if (DidCollide(touch.GetCurrPosition()) && _active_touch < 0) { _active_touch = touch.GetFingerID(); if (EventPress != null) { EventPress(touch); } } }
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); } } } }
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(); } }
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); } }