private void move(TouchData activeTouch, float x, float y) { activeTouch.setData(x, y); if (activeTouch.relativeDeltaPos.magnitude > 0) { TouchEvent e = new TouchEvent(touches, activeTouch); for (int i = 0; i < sortedLayers.Count && !e.isHandled(); i++) { sortedLayers[i].move(e); } } }
private void release(TouchData activeTouch, float x, float y) { activeTouch.setData(x, y); activeTouch.active = false; TouchEvent e = new TouchEvent(touches, activeTouch); bool isSwipe = activeTouch.isSwipe(); for (int i = 0; i < sortedLayers.Count && !e.isHandled(); i++) { //print("releasing on layer " + sortedLayers[i].name); if (isSwipe) { sortedLayers[i].swipe(e); } else { sortedLayers[i].release(e); } } }