Пример #1
0
    private void press(TouchData activeTouch, float x, float y)
    {
        activeTouch.active = true;
        activeTouch.setInitialData(x, y);

        TouchEvent e = new TouchEvent(touches, activeTouch);

        for (int i = 0; i < sortedLayers.Count && !e.isHandled(); i++)
        {
            sortedLayers[i].press(e);
        }
    }
Пример #2
0
    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);
            }
        }
    }
Пример #3
0
    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);
            }
        }
    }