static public int Get(IntPtr l) { try { int argc = LuaDLL.lua_gettop(l); if (matchType(l, argc, 2, typeof(int))) { Hugula.UGUIExtend.ScrollRectItem self = (Hugula.UGUIExtend.ScrollRectItem)checkSelf(l); System.Int32 a1; checkType(l, 2, out a1); var ret = self.Get(a1); pushValue(l, true); pushValue(l, ret); return(2); } else if (matchType(l, argc, 2, typeof(string))) { Hugula.UGUIExtend.ScrollRectItem self = (Hugula.UGUIExtend.ScrollRectItem)checkSelf(l); System.String a1; checkType(l, 2, out a1); var ret = self.Get(a1); pushValue(l, true); pushValue(l, ret); return(2); } pushValue(l, false); LuaDLL.lua_pushstring(l, "No matched override function to call"); return(2); } catch (Exception e) { return(error(l, e)); } }
void PreRender(ScrollRectItem item, int index) { SetPosition(item.rectTransform, index); if (this.onPreRender == null) { onPreRender = (LuaFunction)LuaState.main.doString(PreRenderStr, "onPreRenderStr"); } object dataI = index + 1 <= recordCount ? data[index + 1] : null; onPreRender.call(item, index + 1, dataI); }
public int GetIndex(ScrollRectItem item) { int i = this.repositionTileList.IndexOf(item); int j = -1; if (i >= 0) { j = this.currFirstIndex + i; } return(j); }
public int GetIndex(ScrollRectItem item) { int i = this.repositionTileList.IndexOf(item); int j = -1; if (i >= 0) { i = repositionTileIndexList[i]; } return(j); }
static public int get_refers(IntPtr l) { try { Hugula.UGUIExtend.ScrollRectItem self = (Hugula.UGUIExtend.ScrollRectItem)checkSelf(l); pushValue(l, true); pushValue(l, self.refers); return(2); } catch (Exception e) { return(error(l, e)); } }
void ItemDispose(ScrollRectItem item, int index) { if (onItemDispose != null) { onItemDispose.call(item, index + 1); } if (item) { GameObject.DestroyImmediate(item.gameObject); item = null; } }
void PreRender(ScrollRectItem item, int index) { if (onPreRender != null) { object dataI = index + 1 <= recordCount ? data[index + 1] : null; onPreRender.call(item, index + 1, dataI); } else { onLocalPreRender(item, index + 1); } }
static public int set_fdata(IntPtr l) { try { Hugula.UGUIExtend.ScrollRectItem self = (Hugula.UGUIExtend.ScrollRectItem)checkSelf(l); System.Single v; checkType(l, 2, out v); self.fdata = v; pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
static public int set_rectTransform(IntPtr l) { try { Hugula.UGUIExtend.ScrollRectItem self = (Hugula.UGUIExtend.ScrollRectItem)checkSelf(l); UnityEngine.RectTransform v; checkType(l, 2, out v); self.rectTransform = v; pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
static public int set_refers(IntPtr l) { try { Hugula.UGUIExtend.ScrollRectItem self = (Hugula.UGUIExtend.ScrollRectItem)checkSelf(l); UnityEngine.GameObject[] v; checkArray(l, 2, out v); self.refers = v; pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
public int RemoveChild(ScrollRectItem item) { int i = GetIndex(item); if (i >= 0) { if (onDataRemove == null && LuaState.main != null) { onDataRemove = (LuaFunction)LuaState.main.doString(DataRemoveStr, "onDataRemove"); } onDataRemove.call(this.data, i + 1, this); this.CalcPage(); } return(i); }
void Render() { if (this.preRepositionIntList.Count > 0) { ScrollRectItem item = preRenderList.Dequeue(); int currRenderIndex = this.preRepositionIntList.Dequeue(); if (currRenderIndex + 1 <= recordCount) { SetPosition(item.rectTransform, currRenderIndex); if (onItemRender != null) { onItemRender.call(item, currRenderIndex + 1, data[currRenderIndex + 1]); } } } }
void Render() { if (this.preRenderList.Count > 0) { ScrollRectItem item = preRenderList[0]; currRenderIndex = this.repositionIntList[0]; preRenderList.RemoveAt(0); repositionIntList.RemoveAt(0); if (currRenderIndex + 1 <= recordCount) { if (onItemRender != null) { onItemRender.call(item, currRenderIndex + 1, data[currRenderIndex + 1]); } } } }
internal ScrollRectItem GetItemAndSetPreRender(int currIndex, int newIndex) { int i = repositionTileIndexList.IndexOf(currIndex); if (i == -1) { i = repositionTileIndexList.IndexOf(-1); } ScrollRectItem item = null; if (i >= 0) { repositionTileIndexList[i] = newIndex; item = repositionTileList[i]; preRenderList.Enqueue(item); preRepositionIntList.Enqueue(newIndex); } return(item); }
void PreRightDown(int i) { if (i >= 0 && !repositionIntList.Contains(i) && i + pageSize <= recordCount) //i>pageSize)// { int end1 = repositionTileList.Count - 1; ScrollRectItem tile = repositionTileList[end1]; repositionTileList.RemoveAt(end1); //remove end repositionTileList.Insert(0, tile); //to first this.preRenderList.Add(tile); //add to preRenderList repositionIntList.Add(i); //add data index currFirstIndex--; if (currFirstIndex < 0) { currFirstIndex = 0; } CalcLastEndIndex(); scrollDirection = -1; PreRender(tile, i); } }
void PreLeftUp(int i) { if (i >= this.pageSize && !repositionIntList.Contains(i) && i < this.recordCount) { ScrollRectItem tile = repositionTileList[0]; repositionTileList.RemoveAt(0); //remove first repositionTileList.Add(tile); //to end this.preRenderList.Add(tile); //add to preRenderList repositionIntList.Add(i); //add data index currFirstIndex++; if (currFirstIndex + pageSize > recordCount) { currFirstIndex = recordCount - this.pageSize; } this.lastEndIndex = i; //recorde last render data index scrollDirection = 1; PreRender(tile, i); //call preRender,set Postion } }
void PreRender(ScrollRectItem item, int index) { SetPosition(item.rectTransform, index); if (this.onPreRender == null) onPreRender = (LuaFunction)LuaState.main.doString(PreRenderStr, "onPreRenderStr"); object dataI = index + 1 <= recordCount ? data[index + 1] : null; onPreRender.call(item, index + 1, dataI); }
public int RemoveChild(ScrollRectItem item) { int i = GetIndex(item); if (i >= 0) { if (onDataRemove == null) onDataRemove = (LuaFunction)LuaState.main.doString(DataRemoveStr, "onDataRemove"); onDataRemove.call(this.data, i + 1, this); this.CalcPage(); } return i; }
/// <summary> /// Refresh the specified item's position. /// </summary> /// <param name='item'> /// Item. /// </param> public void Refresh(ScrollRectItem item) { int i = GetIndex(item); if (i >= 0) { i = i + currFirstIndex; PreRefresh(i); } }
public int GetIndex(ScrollRectItem item) { int i = this.repositionTileList.IndexOf(item); int j = -1; if (i >= 0) j = this.currFirstIndex + i; return j; }