void WrapSetting() { List <HeroTypeData> type_Data = MyCsvLoad.Instance.GetHeroTypeDatas(hero_Element, hero_Kingdom, hero_Class); RemoveSelectedHero(type_Data, selectedCardID); wrap.minIndex = 0; wrap.maxIndex = type_Data.Count - 1; wrap.SortBasedOnScrollMovement(); lst_Cards.Sort(SortHeroCardByPositionX); SortCards(); Transform trans = wrap.transform; if (type_Data.Count < card_num) { for (int i = 0; i < card_num; i++) { trans.GetChild(i).gameObject.SetActive((i >= type_Data.Count) ? false : true); } } else { for (int i = 0; i < card_num; i++) { trans.GetChild(i).gameObject.SetActive(true); } } wrap.WrapContent(true); scrollView.ResetPosition(); }
void SortingLastLogin() { lst.Sort(FriendSortByLastLogin); SortAllButton(); lstDatas.Sort(FriendSortByLastLogin); wrap.WrapContent(true); }
void WrapSetting() { wrap.minIndex = -(lst_VipReward.Count - 1); if (lst_VipReward.Count == 1) { wrap.minIndex = 1; } wrap.maxIndex = 0; wrap.SortBasedOnScrollMovement(); Transform trans = wrap.transform; if (lst_VipReward.Count < button_num) { for (int i = 0; i < button_num; i++) { trans.GetChild(i).gameObject.SetActive((i >= lst_VipReward.Count) ? false : true); } } else { for (int i = 0; i < button_num; i++) { trans.GetChild(i).gameObject.SetActive(true); } } wrap.WrapContent(true); scrollView.ResetPosition(); }
public static void IntilizationForWrapContent(UIWrapContent content , int number, GameObject itemPre, List<GameObject> list,bool active , float time, float time2, Action<List<GameObject>> callback = null) { for (int i = 0; i < number; i++) { GameObject gameO = (GameObject)GameObject.Instantiate(itemPre); gameO.transform.parent = content.transform; gameO.transform.localScale = Vector3.one; gameO.transform.localPosition = Vector3.one; gameO.name = i.ToString(); list.Add(gameO); } Utility.instance.WaitForSecs(time2, () => { for (int i = 0; i < list.Count; i++) { if (list[i] != null) list[i].SetActive(active); } }); Utility.instance.WaitForSecs(time, () => { content.WrapContent(); }); }
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 WrapContent(IntPtr L) { LuaScriptMgr.CheckArgsCount(L, 1); UIWrapContent obj = (UIWrapContent)LuaScriptMgr.GetUnityObjectSelf(L, 1, "UIWrapContent"); obj.WrapContent(); return(0); }
static public int WrapContent(IntPtr l) { try { UIWrapContent self = (UIWrapContent)checkSelf(l); self.WrapContent(); pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
static int WrapContent(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); UIWrapContent obj = (UIWrapContent)ToLua.CheckObject <UIWrapContent>(L, 1); obj.WrapContent(); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
public override void OnContentBeginHide() { base.OnContentBeginHide(); if (wrapContent.transform.childCount > 0) { GameObject[] childs = new GameObject[wrapContent.transform.childCount]; for (int i = 0; i < wrapContent.transform.childCount; i++) { childs[i] = wrapContent.transform.GetChild(i).gameObject; } for (int i = 0; i < childs.Length; i++) { childs[i].transform.parent = null; NGUITools.Destroy(childs[i]); } wrapContent.SortBasedOnScrollMovement(); wrapContent.WrapContent(); } }
public static int WrapContent(IntPtr l) { int result; try { UIWrapContent uIWrapContent = (UIWrapContent)LuaObject.checkSelf(l); uIWrapContent.WrapContent(); LuaObject.pushValue(l, true); result = 1; } catch (Exception e) { result = LuaObject.error(l, e); } return(result); }
public override void Parse(IList list) { listData = list; if (list.Count <= 0) { UITools.SA(this, false); } else { if (row <= 1) { wrapContent.minIndex = (listData.Count - 1) * -1; wrapContent.maxIndex = 0; } else { wrapContent.maxIndex = 0; int _minIndex = listData.Count % row == 0 ? listData.Count / row - 1 : listData.Count / row; wrapContent.minIndex = _minIndex * -1; groupData = new ArrayList(); for (int i = 0; i < listData.Count / row; i++) { ArrayList _list = new ArrayList(); for (int j = 0; j < row; j++) { _list.Add(listData[i * row + j]); } groupData.Add(_list); } ArrayList l = new ArrayList(); for (int i = listData.Count - listData.Count % row; i < listData.Count; i++) { l.Add(listData[i]); } if (l.Count != 0) { groupData.Add(l); } } UITools.SA(this, true); wrapContent.mFirstTime = true; wrapContent.WrapContent(); wrapContent.mFirstTime = false; } }
private static int WrapContent(IntPtr L) { int result; try { ToLua.CheckArgsCount(L, 1); UIWrapContent uIWrapContent = (UIWrapContent)ToLua.CheckObject(L, 1, typeof(UIWrapContent)); uIWrapContent.WrapContent(); result = 0; } catch (Exception e) { result = LuaDLL.toluaL_exception(L, e, null); } return(result); }
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 Wrap() { WrapContent.SortBasedOnScrollMovement(); WrapContent.WrapContent(); }