Inheritance: MonoBehaviour, IPointerDownHandler, IPointerUpHandler, IPointerClickHandler
Exemple #1
0
    private void UpdateItem(int index, GameObject item)
    {
        item.SetActive(index < m_datas.Count);

        if (item.activeSelf)
        {
            LoopBaseNode baseNode = item.GetComponent <LoopBaseNode>();
            baseNode.index = index;
            baseNode.data  = m_datas[index];
            baseNode.OnDataChange();
        }
    }
 static int QPYX_OnDataChange_YXQP(IntPtr L_YXQP)
 {
     try
     {
         ToLua.CheckArgsCount(L_YXQP, 1);
         LoopBaseNode QPYX_obj_YXQP = (LoopBaseNode)ToLua.CheckObject <LoopBaseNode>(L_YXQP, 1);
         QPYX_obj_YXQP.OnDataChange();
         return(0);
     }
     catch (Exception e_YXQP)                {
         return(LuaDLL.toluaL_exception(L_YXQP, e_YXQP));
     }
 }
 static int QPYX_OnPointerUp_YXQP(IntPtr L_YXQP)
 {
     try
     {
         ToLua.CheckArgsCount(L_YXQP, 2);
         LoopBaseNode QPYX_obj_YXQP = (LoopBaseNode)ToLua.CheckObject <LoopBaseNode>(L_YXQP, 1);
         UnityEngine.EventSystems.PointerEventData QPYX_arg0_YXQP = (UnityEngine.EventSystems.PointerEventData)ToLua.CheckObject <UnityEngine.EventSystems.PointerEventData>(L_YXQP, 2);
         QPYX_obj_YXQP.OnPointerUp(QPYX_arg0_YXQP);
         return(0);
     }
     catch (Exception e_YXQP)                {
         return(LuaDLL.toluaL_exception(L_YXQP, e_YXQP));
     }
 }
Exemple #4
0
    public LoopBaseNode GetBaseNodeByIndex(int index)
    {
        int count = m_instantiateItems.Count;

        for (int i = 0; i < count; i++)
        {
            LoopBaseNode baseNode = m_instantiateItems[i].GetComponent <LoopBaseNode>();
            if (baseNode.index == index)
            {
                return(baseNode);
            }
        }
        return(null);
    }
Exemple #5
0
 static int OnDataChange(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         LoopBaseNode obj = (LoopBaseNode)ToLua.CheckObject <LoopBaseNode>(L, 1);
         obj.OnDataChange();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static int QPYX_Invoke_YXQP(IntPtr L_YXQP)
 {
     try
     {
         ToLua.CheckArgsCount(L_YXQP, 2);
         UnityEngine.Events.UnityEvent <LoopBaseNode> QPYX_obj_YXQP = (UnityEngine.Events.UnityEvent <LoopBaseNode>)ToLua.CheckObject <UnityEngine.Events.UnityEvent <LoopBaseNode> >(L_YXQP, 1);
         LoopBaseNode QPYX_arg0_YXQP = (LoopBaseNode)ToLua.CheckObject <LoopBaseNode>(L_YXQP, 2);
         QPYX_obj_YXQP.Invoke(QPYX_arg0_YXQP);
         return(0);
     }
     catch (Exception e_YXQP)                {
         return(LuaDLL.toluaL_exception(L_YXQP, e_YXQP));
     }
 }
Exemple #7
0
 static int OnPointerUp(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         LoopBaseNode obj = (LoopBaseNode)ToLua.CheckObject <LoopBaseNode>(L, 1);
         UnityEngine.EventSystems.PointerEventData arg0 = (UnityEngine.EventSystems.PointerEventData)ToLua.CheckObject <UnityEngine.EventSystems.PointerEventData>(L, 2);
         obj.OnPointerUp(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemple #8
0
 static int QPYX_GetBaseNodeByIndex_YXQP(IntPtr L_YXQP)
 {
     try
     {
         ToLua.CheckArgsCount(L_YXQP, 2);
         LoopScrollView QPYX_obj_YXQP  = (LoopScrollView)ToLua.CheckObject <LoopScrollView>(L_YXQP, 1);
         int            QPYX_arg0_YXQP = (int)LuaDLL.luaL_checknumber(L_YXQP, 2);
         LoopBaseNode   QPYX_o_YXQP    = QPYX_obj_YXQP.GetBaseNodeByIndex(QPYX_arg0_YXQP);
         ToLua.Push(L_YXQP, QPYX_o_YXQP);
         return(1);
     }
     catch (Exception e_YXQP)                {
         return(LuaDLL.toluaL_exception(L_YXQP, e_YXQP));
     }
 }
Exemple #9
0
 static int Invoke(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         UnityEngine.Events.UnityEvent <LoopBaseNode> obj = (UnityEngine.Events.UnityEvent <LoopBaseNode>)ToLua.CheckObject <UnityEngine.Events.UnityEvent <LoopBaseNode> >(L, 1);
         LoopBaseNode arg0 = (LoopBaseNode)ToLua.CheckObject <LoopBaseNode>(L, 2);
         obj.Invoke(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static int GetBaseNodeByIndex(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         LoopScrollView obj  = (LoopScrollView)ToLua.CheckObject <LoopScrollView>(L, 1);
         int            arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
         LoopBaseNode   o    = obj.GetBaseNodeByIndex(arg0);
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemple #11
0
 private void UpdateItem(int index, GameObject item)
 {
     item.SetActive(index < m_datas.Count);
     if (item.activeSelf)
     {
         item.name = "item" + index;//TODO 更新name 我们现在取列表数据都是通过name来的
         LoopBaseNode baseNode = item.GetComponent <LoopBaseNode>();
         baseNode.index = index;
         baseNode.data  = m_datas[index];
         baseNode.OnDataChange();
         if (OnDataChange != null)
         {
             OnDataChange.Invoke(baseNode);
         }
     }
 }
Exemple #12
0
    static int set_index(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            LoopBaseNode obj  = (LoopBaseNode)o;
            int          arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
            obj.index = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index index on a nil value"));
        }
    }
Exemple #13
0
    static int get_loopScrollView(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            LoopBaseNode   obj = (LoopBaseNode)o;
            LoopScrollView ret = obj.loopScrollView;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index loopScrollView on a nil value"));
        }
    }
Exemple #14
0
    static int get_localTrans(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            LoopBaseNode          obj = (LoopBaseNode)o;
            UnityEngine.Transform ret = obj.localTrans;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index localTrans on a nil value"));
        }
    }
Exemple #15
0
    static int get_onDataChange(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            LoopBaseNode obj = (LoopBaseNode)o;
            LoopScrollView.OnDataChangeEvent ret = obj.onDataChange;
            ToLua.PushObject(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index onDataChange on a nil value"));
        }
    }
Exemple #16
0
    static int get_data(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            LoopBaseNode obj = (LoopBaseNode)o;
            object       ret = obj.data;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index data on a nil value"));
        }
    }
Exemple #17
0
    static int get_index(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            LoopBaseNode obj = (LoopBaseNode)o;
            int          ret = obj.index;
            LuaDLL.lua_pushinteger(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index index on a nil value"));
        }
    }
Exemple #18
0
    static int set_onDataChange(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            LoopBaseNode obj = (LoopBaseNode)o;
            LoopScrollView.OnDataChangeEvent arg0 = (LoopScrollView.OnDataChangeEvent)ToLua.CheckObject <LoopScrollView.OnDataChangeEvent>(L, 2);
            obj.onDataChange = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index onDataChange on a nil value"));
        }
    }
Exemple #19
0
    static int set_data(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            LoopBaseNode obj  = (LoopBaseNode)o;
            object       arg0 = ToLua.ToVarObject(L, 2);
            obj.data = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index data on a nil value"));
        }
    }
Exemple #20
0
    private void InitItemsPosition()
    {
        LoopBaseNode  baseNode  = null;
        RectTransform rectTrans = null;
        int           count     = m_instantiateItems.Count;

        for (int i = 0; i < count; i++)
        {
            baseNode       = m_instantiateItems[i].GetComponent <LoopBaseNode>();
            baseNode.index = i;
            baseNode.data  = m_datas[i];
            baseNode.OnDataChange();
            if (OnDataChange != null)
            {
                OnDataChange.Invoke(baseNode);
            }
            rectTrans = m_instantiateItems[i].GetComponent <RectTransform>();
            rectTrans.anchoredPosition = GetCenterPosByIndex(i);
        }
    }
Exemple #21
0
    private void CreateItem(int index)
    {
        RectTransform item = GameObject.Instantiate(m_cell);

        item.SetParent(m_contentRect.transform, false);
        item.anchorMax = Vector2.up;
        item.anchorMin = Vector2.up;
        item.pivot     = Vector2.up;
        item.name      = "item" + index;

        item.anchoredPosition = direction == Direction.Horizontal ?
                                new Vector2(Mathf.Floor(index / instantiateSize.x) * m_cellRect.x, -(index % instantiateSize.x) * m_cellRect.y) :
                                new Vector2((index % instantiateSize.y) * m_cellRect.x, -Mathf.Floor(index / instantiateSize.y) * m_cellRect.y);
        m_instantiateItems.Add(item);
        item.gameObject.SetActive(true);
        LoopBaseNode baseNode = item.GetComponent <LoopBaseNode>();

        baseNode.index = index;
        baseNode.data  = m_datas[index];
        baseNode.OnDataChange();
    }
    static int QPYX_get_loopScrollView_YXQP(IntPtr L_YXQP)
    {
        object QPYX_o_YXQP = null;

        try
        {
            QPYX_o_YXQP = ToLua.ToObject(L_YXQP, 1);                        LoopBaseNode QPYX_obj_YXQP = (LoopBaseNode)QPYX_o_YXQP;
            LoopScrollView QPYX_ret_YXQP = QPYX_obj_YXQP.loopScrollView;
            ToLua.Push(L_YXQP, QPYX_ret_YXQP);
            return(1);
        }
        catch (Exception QPYX_e_YXQP)            {
            return(LuaDLL.toluaL_exception(L_YXQP, QPYX_e_YXQP, QPYX_o_YXQP, "attempt to index loopScrollView on a nil value"));
        }
    }
    static int QPYX_set_onDataChange_YXQP(IntPtr L_YXQP)
    {
        object QPYX_o_YXQP = null;

        try
        {
            QPYX_o_YXQP = ToLua.ToObject(L_YXQP, 1);                        LoopBaseNode QPYX_obj_YXQP = (LoopBaseNode)QPYX_o_YXQP;
            LoopScrollView.OnDataChangeEvent QPYX_arg0_YXQP = (LoopScrollView.OnDataChangeEvent)ToLua.CheckObject <LoopScrollView.OnDataChangeEvent>(L_YXQP, 2);
            QPYX_obj_YXQP.onDataChange = QPYX_arg0_YXQP;
            return(0);
        }
        catch (Exception QPYX_e_YXQP)            {
            return(LuaDLL.toluaL_exception(L_YXQP, QPYX_e_YXQP, QPYX_o_YXQP, "attempt to index onDataChange on a nil value"));
        }
    }
    static int QPYX_set_data_YXQP(IntPtr L_YXQP)
    {
        object QPYX_o_YXQP = null;

        try
        {
            QPYX_o_YXQP = ToLua.ToObject(L_YXQP, 1);                        LoopBaseNode QPYX_obj_YXQP = (LoopBaseNode)QPYX_o_YXQP;
            object QPYX_arg0_YXQP = ToLua.ToVarObject(L_YXQP, 2);
            QPYX_obj_YXQP.data = QPYX_arg0_YXQP;
            return(0);
        }
        catch (Exception QPYX_e_YXQP)            {
            return(LuaDLL.toluaL_exception(L_YXQP, QPYX_e_YXQP, QPYX_o_YXQP, "attempt to index data on a nil value"));
        }
    }
    static int QPYX_set_index_YXQP(IntPtr L_YXQP)
    {
        object QPYX_o_YXQP = null;

        try
        {
            QPYX_o_YXQP = ToLua.ToObject(L_YXQP, 1);                        LoopBaseNode QPYX_obj_YXQP = (LoopBaseNode)QPYX_o_YXQP;
            int QPYX_arg0_YXQP = (int)LuaDLL.luaL_checknumber(L_YXQP, 2);
            QPYX_obj_YXQP.index = QPYX_arg0_YXQP;
            return(0);
        }
        catch (Exception QPYX_e_YXQP)            {
            return(LuaDLL.toluaL_exception(L_YXQP, QPYX_e_YXQP, QPYX_o_YXQP, "attempt to index index on a nil value"));
        }
    }
    static int QPYX_get_index_YXQP(IntPtr L_YXQP)
    {
        object QPYX_o_YXQP = null;

        try
        {
            QPYX_o_YXQP = ToLua.ToObject(L_YXQP, 1);                        LoopBaseNode QPYX_obj_YXQP = (LoopBaseNode)QPYX_o_YXQP;
            int QPYX_ret_YXQP = QPYX_obj_YXQP.index;
            LuaDLL.lua_pushinteger(L_YXQP, QPYX_ret_YXQP);
            return(1);
        }
        catch (Exception QPYX_e_YXQP)            {
            return(LuaDLL.toluaL_exception(L_YXQP, QPYX_e_YXQP, QPYX_o_YXQP, "attempt to index index on a nil value"));
        }
    }
    static int QPYX_get_localTrans_YXQP(IntPtr L_YXQP)
    {
        object QPYX_o_YXQP = null;

        try
        {
            QPYX_o_YXQP = ToLua.ToObject(L_YXQP, 1);                        LoopBaseNode QPYX_obj_YXQP = (LoopBaseNode)QPYX_o_YXQP;
            UnityEngine.Transform QPYX_ret_YXQP = QPYX_obj_YXQP.localTrans;
            ToLua.Push(L_YXQP, QPYX_ret_YXQP);
            return(1);
        }
        catch (Exception QPYX_e_YXQP)            {
            return(LuaDLL.toluaL_exception(L_YXQP, QPYX_e_YXQP, QPYX_o_YXQP, "attempt to index localTrans on a nil value"));
        }
    }
 private void OnItemClick(LoopBaseNode node)
 {
     Debug.Log(node.data);
 }
Exemple #29
0
 private void OnItemClick(LoopBaseNode node)
 {
     Debug.Log(node.data);
 }