Ejemplo n.º 1
0
 static int OnBeginDrag(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         UIScrollRect obj = (UIScrollRect)ToLua.CheckObject(L, 1, typeof(UIScrollRect));
         UnityEngine.EventSystems.PointerEventData arg0 = (UnityEngine.EventSystems.PointerEventData)ToLua.CheckObject(L, 2, typeof(UnityEngine.EventSystems.PointerEventData));
         obj.OnBeginDrag(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Ejemplo n.º 2
0
    public void OnBeginDrag(PointerEventData eventData)
    {
        Vector3 delta = new Vector3(eventData.delta.x, eventData.delta.y, 0);

        if (Mathf.Abs(eventData.delta.y) > Mathf.Abs(eventData.delta.x))
        {
            m_IsSideslip = false;
            uiScrollRect.OnBeginDrag(eventData);
        }
        else
        {
            m_IsSideslip = true;
            object[] param = { UIEVENT.DRAGSENSOR, controlID, delta };
            uiMod.OnEvent(param);
        }
    }