void WrapSetting() { List <AchivementTypeData> type_Data = MyCsvLoad.Instance.GetAchivementTypeDivideByTabName(current_tab); //Dictionary<string, AchivementTypeData> dic_type = MyCsvLoad.Instance.GetAchivementTypeDatas(); wrap.minIndex = -(type_Data.Count - 1); if (type_Data.Count == 1) { wrap.minIndex = 1; } wrap.maxIndex = 0; Transform trans = wrap.transform; if (type_Data.Count < 10) { for (int i = type_Data.Count; i < trans.childCount; i++) { trans.GetChild(i).gameObject.SetActive(false); } } else { for (int i = 0; i < trans.childCount; i++) { trans.GetChild(i).gameObject.SetActive(true); } } wrap.SortAlphabetically(); wrap.WrapContent(true); scrollView.ResetPosition(); }
static int SortAlphabetically(IntPtr L) { LuaScriptMgr.CheckArgsCount(L, 1); UIWrapContent obj = (UIWrapContent)LuaScriptMgr.GetUnityObjectSelf(L, 1, "UIWrapContent"); obj.SortAlphabetically(); return(0); }
void SetWrapContent(UIGrid grid, List <ItemDataManager.ItemData> dataList, Dictionary <int, PropsItem> dataDic, UIWrapContent.OnInitializeItem OnUpdateItemMain) { grid.enabled = true; int tankCont = dataList.Count; int gridCont = grid.GetChildList().Count; int itemCount = 0; if (tankCont % 2 == 0) { itemCount = tankCont / 2; } else { itemCount = tankCont / 2 + 1; } if (itemCount <= 3) { if (grid.gameObject.GetComponent <UIWrapContent>()) { NGUITools.Destroy(grid.gameObject.GetComponent <UIWrapContent>()); } if (gridCont != itemCount) { StartCoroutine(CreateUnit(grid, dataList, dataDic)); } } else { UIWrapContent wrap = null; if (grid.gameObject.GetComponent <UIWrapContent>()) { wrap = grid.gameObject.GetComponent <UIWrapContent>(); } else { grid.gameObject.AddComponent <UIWrapContent>(); wrap = grid.gameObject.GetComponent <UIWrapContent>(); } _wrapList.Add(wrap); if (gridCont != 4) { if (grid != null) { grid.DestoryAllChildren(); } CreateWrapUnit(grid, 4); if (wrap != null) { //绑定方法 wrap.itemSize = (int)grid.cellHeight; wrap.minIndex = -(itemCount - 1); wrap.maxIndex = 0; wrap.onInitializeItem = OnUpdateItemMain; wrap.SortAlphabetically(); } } } }
static public int SortAlphabetically(IntPtr l) { try { UIWrapContent self = (UIWrapContent)checkSelf(l); self.SortAlphabetically(); pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
static int SortAlphabetically(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); UIWrapContent obj = (UIWrapContent)ToLua.CheckObject <UIWrapContent>(L, 1); obj.SortAlphabetically(); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
void SetWrapContent(UIGrid grid, List <TankDataManager.UnitData> dataList, Dictionary <int, StrengthenTankItem> dataDic, UIWrapContent.OnInitializeItem OnUpdateItemMain) { int tankCont = dataList.Count; int gridCont = grid.GetChildList().Count; if (tankCont <= 7) { if (grid.gameObject.GetComponent <UIWrapContent>()) { NGUITools.Destroy(grid.gameObject.GetComponent <UIWrapContent>()); } if (gridCont != tankCont) { StartCoroutine(CreateUnit(grid, dataList, dataDic)); } _scrollview.enabled = false; } else { _scrollview.enabled = true; UIWrapContent wrap = null; if (grid.gameObject.GetComponent <UIWrapContent>()) { wrap = grid.gameObject.GetComponent <UIWrapContent>(); } else { grid.gameObject.AddComponent <UIWrapContent>(); wrap = grid.gameObject.GetComponent <UIWrapContent>(); } if (gridCont != 8) { if (grid != null) { grid.DestoryAllChildren(); } CreateWrapUnit(grid, 8); if (wrap != null) { //绑定方法 wrap.itemSize = (int)grid.cellWidth; wrap.minIndex = 0; wrap.maxIndex = (tankCont - 1); wrap.onInitializeItem = OnUpdateItemMain; wrap.enabled = true; wrap.SortAlphabetically(); } } } }
public static int SortAlphabetically(IntPtr l) { int result; try { UIWrapContent uIWrapContent = (UIWrapContent)LuaObject.checkSelf(l); uIWrapContent.SortAlphabetically(); LuaObject.pushValue(l, true); result = 1; } catch (Exception e) { result = LuaObject.error(l, e); } return(result); }
private static int SortAlphabetically(IntPtr L) { int result; try { ToLua.CheckArgsCount(L, 1); UIWrapContent uIWrapContent = (UIWrapContent)ToLua.CheckObject(L, 1, typeof(UIWrapContent)); uIWrapContent.SortAlphabetically(); result = 0; } catch (Exception e) { result = LuaDLL.toluaL_exception(L, e, null); } return(result); }
// void SetWrapContent(UIGrid grid, UIScrollView scrollView, List <Model_Unit> dataList, UIWrapContent.OnInitializeItem OnUpdateItemMain) { int tankCont = dataList.Count; int itemCount = 0; if (tankCont <= 4) { scrollView.enabled = false; } else { scrollView.enabled = true; } if (tankCont % 2 == 0) { itemCount = tankCont / 2; } else { itemCount = tankCont / 2 + 1; } UIWrapContent wrap = null; if (grid.gameObject.GetComponent <UIWrapContent>()) { wrap = grid.gameObject.GetComponent <UIWrapContent>(); } else { grid.gameObject.AddComponent <UIWrapContent>(); wrap = grid.gameObject.GetComponent <UIWrapContent>(); } if (wrap != null) { //绑定方法 wrap.itemSize = (int)grid.cellHeight; wrap.minIndex = -(itemCount - 1); wrap.maxIndex = 0; wrap.onInitializeItem = OnUpdateItemMain; wrap.enabled = true; wrap.SortAlphabetically(); } }
protected void EventResetPosition() { for (int i = 0; i < _iCountScrollItem; i++) { _listScrollViewItem[i].SetActive(i < _iCountRealItem); } int iMaxItem = Mathf.Max(1, _iCountRealItem - 1); _pUIWrapContent.minIndex = -iMaxItem; _pUIWrapContent.maxIndex = 0; _pUIWrapContent.SortAlphabetically(); _pUIWrapContent.WrapContent(); if (_iCountRealItem < _iCountScrollItem) { _pUIScrollView.ResetPosition(); _pUIScrollView.RestrictWithinBounds(true); } ProcCheckDisableDrag(); }
void SetWrapContent(UIGrid grid, UIScrollView scrollview, List <SlgPB.PVPUser> dataList, UIWrapContent.OnInitializeItem OnUpdateItemMain) { int dataCount = dataList.Count; if (dataCount <= 7) { scrollview.enabled = false; } else { scrollview.enabled = true; } Trace.trace("dataCount " + dataCount, Trace.CHANNEL.UI); UIWrapContent wrap = null; if (grid.gameObject.GetComponent <UIWrapContent>()) { wrap = grid.gameObject.GetComponent <UIWrapContent>(); } else { grid.gameObject.AddComponent <UIWrapContent>(); wrap = grid.gameObject.GetComponent <UIWrapContent>(); } if (wrap != null) { //绑定方法 wrap.itemSize = (int)grid.cellHeight; wrap.minIndex = -(dataCount - 1); wrap.maxIndex = 0; wrap.onInitializeItem = OnUpdateItemMain; wrap.enabled = true; wrap.SortAlphabetically(); } }
void SetWrapContent(UIGrid grid, UIScrollView scrollview, List <HeroDataManager.HeroData> heroDataList, UIWrapContent.OnInitializeItem OnUpdateItemMain) { int dataCount = heroDataList.Count; if (dataCount <= 10) { _gridChildList[2].SetActive(false); scrollview.enabled = false; } else { _gridChildList[2].SetActive(true); scrollview.enabled = true; } UIWrapContent wrap = null; if (grid.gameObject.GetComponent <UIWrapContent>()) { wrap = grid.gameObject.GetComponent <UIWrapContent>(); } else { grid.gameObject.AddComponent <UIWrapContent>(); wrap = grid.gameObject.GetComponent <UIWrapContent>(); } if (wrap != null) { //绑定方法 wrap.itemSize = (int)grid.cellHeight; wrap.minIndex = -(dataCount - 1); wrap.maxIndex = 0; wrap.onInitializeItem = OnUpdateItemMain; wrap.enabled = true; wrap.SortAlphabetically(); } }