private void OnClickButton(int i) { // 优先使用热更新的代码 if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("Activity_hotfix", "OnClickButton")) { ILRuntimeUtil.getInstance().getAppDomain() .Invoke("HotFix_Project.Activity_hotfix", "OnClickButton", null, i); return; } DeleteAllItem(Content); activityToggles.Clear(); switch (i) { case 0: TabImage.transform.localPosition = new Vector3(-83, 0, 0); uiWarpContent.onInitializeItem = onInitializeItemActivity; uiWarpContent.Init(activityDatas.Count); break; case 1: TabImage.transform.localPosition = new Vector3(83, 0, 0); DeleteAllItem(RightBg); uiWarpContent.onInitializeItem = onInitializeItemNotice; uiWarpContent.Init(noticeDatas.Count); break; } }
/// <summary> /// 服务器发来好友排行 /// </summary> public void G2C_FriendRank(List <FriendInfo> rankInfos) { this.friendRankInfos = rankInfos; SortByState(); warp.Init(rankInfos.Count); noFriendObj.SetActive(rankInfos.Count == 0); }
public void Init() { // 优先使用热更新的代码 if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("ShopPanelScript_hotfix", "Init")) { ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.ShopPanelScript_hotfix", "Init", null, null); return; } try { for (int i = shopDataList.Count - 1; i >= 0; i--) { uiWarpContent.DelItem(i); } _shopItemDatas = new List <ShopData>(); for (int i = 0; i < shopDataList.Count; i++) { ShopData shopData = shopDataList[i]; if (shopData.goods_type == _type) { _shopItemDatas.Add(shopData); } } uiWarpContent.Init(_shopItemDatas.Count); } catch (Exception e) { LogUtil.Log(e.Message); } }
public override void OnStart() { base.OnStart(); //滑动列表相关配置 TempAddBagItem(20);//给背包添加假数据 warpContentItem = Resources.Load <GameObject>("UIPrefab/WarpContentItem"); if (null == warpContentItem) { Debug.LogError("背包内item预制体不存在或路径错误!!"); return; } warpContent = transform.FindChildPlus("Scroll View").GetComponent <UIWarpContent>(); #region 代码配置滑动列表 if (null == warpContent) { warpContent = transform.FindChildPlus("Scroll View").gameObject.AddComponent <UIWarpContent>(); warpContent.arrangement = UIWarpContent.Arrangement.Vertical; warpContent.maxPerLine = 1; warpContent.cellHeight = 100; warpContent.cellWidth = 160; warpContent.cellHeightSpace = 10; warpContent.scrollRect = transform.FindChildPlus("Scroll View").GetComponent <ScrollRect>(); warpContent.content = transform.FindChildPlus("Content").GetComponent <RectTransform>(); warpContent.goItemPrefab = warpContentItem; } #endregion warpContent.onInitializeItem = onInitializeItem; warpContent.Init(20); }
private void Init() { leftWarp.onInitializeItem = InitProvinceItem; rightWarp.onInitializeItem = InitCitysItem; leftRect.stopScrollCallback = OnStop; rightRect.stopScrollCallback = OnStop; leftWarp.Init(datas.Count, () => { int minIndex = GetMinIndex(leftWarp.content); leftRect.content.transform.localPosition = new Vector3(0, minIndex * 100 + 30); Transform[] items = leftWarp.GetComponentsInChildren <Transform>(); leftChilds.Clear(); leftChilds.AddRange(items); leftWarp.ShowIndex(0); OnStop(leftRect.gameObject); }); UGUIEventListener.Get(mask).onClick = delegate { gameObject.SetActive(false); UserInfoModel.userInfo.province = string.Format(GetSelectProvince() + " " + GetSelectCity()); SocketClient.Instance.AddSendMessageQueue(new C2GMessage() { msgid = MessageId.C2G_UpdateUser, updateUser = new UpdateUser() { type = 1, province = string.Format(UserInfoModel.userInfo.province) } }); }; }
public override void Awake(GameObject go) { transform.Find("Btn_Close").GetComponent <Button>().onClick.AddListener(() => { ClosePage <BagUI>(); }); //滑动列表相关配置 TempAddBagItem(20);//给背包添加假数据 warpContentItem = Resources.Load <GameObject>("UIPrefab/WarpContentItem"); if (null == warpContentItem) { Debug.LogError("背包内item预制体不存在或路径错误!!"); return; } warpContent = transform.FindChildPlus("Scroll View").GetComponent <UIWarpContent>(); #region 代码配置滑动列表 if (null == warpContent) { warpContent = transform.FindChildPlus("Scroll View").gameObject.AddComponent <UIWarpContent>(); warpContent.arrangement = UIWarpContent.Arrangement.Vertical; warpContent.maxPerLine = 1; warpContent.cellHeight = 100; warpContent.cellWidth = 160; warpContent.cellHeightSpace = 10; warpContent.scrollRect = transform.FindChildPlus("Scroll View").GetComponent <ScrollRect>(); warpContent.content = transform.FindChildPlus("Content").GetComponent <RectTransform>(); warpContent.goItemPrefab = warpContentItem; } #endregion warpContent.onInitializeItem = onInitializeItem; warpContent.Init(BagItemData.GetNum()); }
public void UpdateUI() { // 优先使用热更新的代码 if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("BagPanelScript_hotfix", "UpdateUI")) { ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.BagPanelScript_hotfix", "UpdateUI", null, null); return; } if (Instance != null) { for (int i = UserData.propData.Count - 1; i >= 0; i--) { deleteItem(i); } foreach (var prop in UserData.propData) { LogUtil.Log(prop.prop_icon + " " + prop.prop_name + " " + prop.prop_id); LogUtil.Log("-------"); } uiWarpContent.Init(UserData.propData.Count); if (UserData.propData.Count == 0) { NoProp.transform.localScale = Vector3.one; } else { NoProp.transform.localScale = Vector3.zero; } } }
// Use this for initialization public void setupWarpData(List <Top> listItem) { listItem_ = listItem; //scrollView 相关所需注意接口 warpContent = gameObject.transform.GetComponentInChildren <UIWarpContent> (); if (warpContent != null) { warpContent.onInitializeItem = onInitializeItem; //注意:目标init方法必须在warpContent.onInitializeItem之后 warpContent.Init(listItem.Count); } }
public void GetNoticeData(string result) { NoticelDataScript.getInstance().initJson(result); foreach (var noticeData in NoticelDataScript.getInstance().getNoticeDataList()) { if (noticeData.type == 1) { noticeDatas.Add(noticeData); } } uiWarpContent.Init(noticeDatas.Count); }
void Start() { //测试数据 listItem = new List <Item> (); for (int i = 0; i < 50; i++) { listItem.Add(new Item("测试:" + Random.Range(1, 1000))); } //scrollView 相关所需注意接口 warpContent = gameObject.transform.GetComponentInChildren <UIWarpContent> (); warpContent.onInitializeItem = onInitializeItem; //注意:目标init方法必须在warpContent.onInitializeItem之后 warpContent.Init(listItem.Count); }
static int Init(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); UIWarpContent obj = (UIWarpContent)ToLua.CheckObject(L, 1, typeof(UIWarpContent)); int arg0 = (int)LuaDLL.luaL_checknumber(L, 2); obj.Init(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
void Start() { //1. init initMapItemCount, read from config file, chapter count for default; for (int i = 0; i < initMapItemCount; i++) { MapItem mapItem = new MapItem("chapter" + i); mapItem.IsChapter = true; mapItem.StarsCount = i; mapItem.LevelCount = 10; mapItem.TotalStarsCount = 10; mapItem.Status = MapItemStatus.Collipsed; m_mapItems.Add(mapItem); } //scrollView 相关所需注意接口 m_wrapContent = gameObject.transform.GetComponentInChildren <UIWarpContent>(); m_wrapContent.onInitializeItem = onInitializeItem; //注意:目标init方法必须在warpContent.onInitializeItem之后 m_wrapContent.Init(m_mapItems.Count); }