protected override void Init() { ItemSkin = transform.Find("item").gameObject; MaterialController = UITool.GetUIComponent <RectTransform>(transform, "Controller"); MaterialController.gameObject.SetActive(true); MaterialController.SetParent(ContentRectTrans.parent); MaterialController.localScale = Vector3.one; materialDelete = UITool.GetUIComponent <Button>(MaterialController, "Delete"); materialDelete.onClick.AddListener(RemoveMaterial); cancelDelete = UITool.GetUIComponent <Image>(MaterialController, "Delete/cancelDelete"); UDragScroll uscr = ItemSkin.AddComponent <UDragScroll>(); uscr.scroRect = ScroRect; ItemSkin.AddComponent <MaterailImageItemFunc>(); specialitem = new MaterialItemData("", "", ""); specialitemBottom = new MaterialItemData("", "", ""); specialitemBottom.special = true; specialitem.special = true; SetData(100, 130, _arrangement, 100, 100, 10, 30, 1); //for (int i = 0; i < 1; i++) //{ // Msgs.Add(new ItemData()); //} //RefreshDisplay(Msgs,false,true); //skinClone.SetActive(false); //Display(Msgs); }
protected override void Init() { ItemSkin = transform.Find("itemPictures").gameObject; ItemSkin.AddComponent <SetMainOfferItemFunc>(); UDragScroll uscr = ItemSkin.AddComponent <UDragScroll>(); uscr.scroRect = ScroRect; SetData(1980, 200, _arrangement, 6, 20); //Display(msgs); }
protected override void Init() { ItemSkin = transform.Find("ImageItemSkin").gameObject; view = ItemSkin.transform.FindChild("GameObject/view").gameObject; UDragScroll uscr = view.AddComponent <UDragScroll>(); uscr.scroRect = ScroRect; ItemSkin.AddComponent <SchemeEffectImageItemFunc>(); SetData(672, 504, _arrangement, 6, 20, 70, 30, 2); }
protected override void Init() { base.Init(); ItemSkin = transform.Find("item").gameObject; ItemSkin.AddComponent <LobbyRoomItemFunction>(); UDragScroll uscr = ItemSkin.AddComponent <UDragScroll>(); uscr.scroRect = ScroRect; SetData(640, 80, arragement, 6, 20, 10, 5); }
protected override void Init() { base.Init(); ItemSkin = transform.Find("item").gameObject; ItemSkin.AddComponent <ProductItemFunction>(); UDragScroll uscr = ItemSkin.AddComponent <UDragScroll>(); uscr.scroRect = ScroRect; SetData(440, 460, _arrangement, 100, 100, 50, 50, 2); }
protected override void Init() { ItemSkin = transform.Find("itemPictures").gameObject; UDragScroll us = ItemSkin.AddComponent <UDragScroll>(); schemePage.scheme.mask.SetAsLastSibling(); us.scroRect = ScroRect; ItemSkin.AddComponent <GenerateOfferItemFunc>(); SetData(1980, 200, _arrangement, 6, 20); AddDeleteEvent(DeleteAllSelectItem); AddToggleEvent(ToggleOffOrOn); }
protected override void Init() { ItemSkin = transform.Find("ManifestItemSkin").gameObject; view = ItemSkin.transform.FindChild("view").gameObject; UDragScroll uscr = view.AddComponent <UDragScroll>(); uscr.scroRect = ScroRect; ItemSkin.AddComponent <SchemeManifestItemFunc>(); specialitem = new ManifestOfferItem("", "", "", "", "", "", 0); specialitem.special = true; SetData(672, 504, _arrangement, 6, 20, 70, 30, 2); // 初始化以后就隐藏 点击清单 在出现 UITool.SetActionFalse(this.gameObject); }
protected override void Init() { ItemSkin = transform.Find("itemModel").gameObject; ItemSkin.AddComponent <OfferModerItemFunc>(); UDragScroll uscr = ItemSkin.AddComponent <UDragScroll>(); uscr.scroRect = ScroRect; SetData(994, 200, _arrangement, _upperLimitIndex, _lowerLimitIndex, _cellWidthSpace, _cellHeightSpace, 2); // 测试 //for (int i = 0; i < 20; i++) //{ // msgs.Add(new ItemData()); //} //Display(msgs); }
protected override void Init() { ItemSkin = transform.Find("itemSkin").gameObject; ItemSkin.AddComponent <EnvironmentItemFunc>(); UDragScroll uscr = ItemSkin.AddComponent <UDragScroll>(); uscr.scroRect = ScroRect; SetData(262, 80, _arrangement, 6, 20, 0, 20); itemList.Add(new EnvironmentItemData("草色青青")); itemList.Add(new EnvironmentItemData("高楼林立")); itemList.Add(new EnvironmentItemData("街道夜色")); itemList.Add(new EnvironmentItemData("无外景")); itemList.Add(new EnvironmentItemData("碧水蓝天")); itemList.Add(new EnvironmentItemData("绵绵小溪")); RefreshDisplay(itemList); }
private GameObject GetInstance() { if (skinList.Count > 0) { return(skinList.Pop()); } GameObject cloneSkin = GameObject.Instantiate(itemSkin); UDragScroll uDrag = cloneSkin.AddComponent <UDragScroll>(); ItemFunc func = cloneSkin.AddComponent <ItemFunc>(); GameObject itemview = cloneSkin.transform.FindChild("view").gameObject; GameObject itemOffer = cloneSkin.transform.FindChild("view/Offer").gameObject; UDragScroll viewScroll = itemview.AddComponent <UDragScroll>(); viewScroll.scroRect = scroRect; UDragScroll offerScroll = itemOffer.AddComponent <UDragScroll>(); offerScroll.scroRect = scroRect; cloneSkin.SetActive(true); return(cloneSkin); }
public void RefreshDisplay(ItemData[] msgs = null, bool resetPos = false) { foreach (ItemFunc item in itemDic.Values) { skinList.Push(item.gameObject); } itemDic.Clear(); if (resetPos == true) { ResetPosition(); } if (msgs != null) { ResetHeight(msgs.Length); this.msgs = msgs; } for (int i = 0; i < this.msgs.Length; i++) { if (i < currentIndex - 6 || i > currentIndex + 20) { continue; } GameObject cloneSkin = GetInstance(); UDragScroll uDrag = cloneSkin.GetComponent <UDragScroll>(); ItemFunc func = cloneSkin.GetComponent <ItemFunc>(); cloneSkin.transform.localPosition = content.GetLocalPositionByIndex(i); uDrag.scroRect = scroRect; func.OnChange = ItemIndexChange; func.scroRect = scroRect; func.data = this.msgs[i]; func.index = i; itemDic.Add(i, func); cloneSkin.transform.SetParent(contentRect, false); cloneSkin.name = "" + func.index; cloneSkin.GetComponent <RectTransform>().SetSiblingIndex(i); } }
protected override void Init() { ItemSkin = transform.Find("item").gameObject; viewRect.anchoredPosition = Vector2.right * 20; //controllerAddDelet = UITool.GetUIComponent<RectTransform>(transform, "Controller"); //UITool.SetActionTrue(controllerAddDelet.gameObject); //controllerMove.SetParent(ContentRectTrans); //controllerMove.localScale = Vector3.one; //addItem = UITool.GetUIComponent<Button>(ScrollRectTrans, "Add"); showDelete = UITool.GetUIComponent <Button>(ScrollRectTrans, "Delete"); showDelete.onClick.AddListener(onDeleteCameraView); cancelDelete = UITool.GetUIComponent <Image>(ScrollRectTrans, "Delete/cancelDelete"); UDragScroll uscr = ItemSkin.AddComponent <UDragScroll>(); uscr.scroRect = ScroRect; ItemSkin.AddComponent <CamereViewItemFunc>(); _Arranement = Arrangement.Vertical; SetData(320, 240, _Arranement, 6, 6, 20, 20); viewRect.SetAsFirstSibling(); }