static public Cell Get(HS_UIListViewCell cell) { Transform t = cell.transform; Cell obj = new Cell(); obj._image = HS_Base.FindProperty <UnityEngine.UI.Image>(t, "Image"); obj._index = HS_Base.FindProperty <UnityEngine.UI.Text>(t, "Index"); obj._data = HS_Base.FindProperty <UnityEngine.UI.Text>(t, "Data"); return(obj); }
override protected void OnListViewClick(HS_UIListView listView, HS_UIListViewCell cell, GameObject target) { base.OnListViewClick(listView, cell, target); //HS_CallLuaFace.CallMemberOnce(_LuaTable, "OnListViewClick", listView, cell, target); LuaFunction func = _LuaTable.GetLuaFunction("OnListViewClick"); int oldTop = _LuaTable.GetLuaState().LuaGetTop(); func.BeginPCall(); func.Push(listView); func.Push(cell); func.Push(target); func.PCall(); func.EndPCall(); func.Dispose(); }
override protected void OnListViewInit(HS_ListViewBase listView, HS_UIListViewCell cell, object data) { base.OnListViewInit(listView, cell, data); //HS_CallLuaFace.CallMemberOnce(_LuaTable, "OnListViewInit", listView, cell, data); LuaFunction func = _LuaTable.GetLuaFunction("OnListViewInit"); int oldTop = _LuaTable.GetLuaState().LuaGetTop(); func.BeginPCall(); func.Push(listView); func.Push(cell); func.Push(data); func.PCall(); func.EndPCall(); func.Dispose(); }
override protected void OnListViewInit(HS_ListViewBase listView, HS_UIListViewCell cell, object data) { CellData cd = (CellData)data; TVUIScrollRect.Cell c = TVUIScrollRect.Get(cell); c._index.text = cd.index.ToString(); c._data.text = cd.data.ToString(); if (cd.index == 0) { c._image.color = Color.green; } else if (cd.index == 9) { c._image.color = Color.yellow; } }