From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../XMainClient/UI/AuctionWrapContentGroup.cs | 62 ++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/UI/AuctionWrapContentGroup.cs (limited to 'Client/Assets/Scripts/XMainClient/UI/AuctionWrapContentGroup.cs') diff --git a/Client/Assets/Scripts/XMainClient/UI/AuctionWrapContentGroup.cs b/Client/Assets/Scripts/XMainClient/UI/AuctionWrapContentGroup.cs new file mode 100644 index 00000000..c30f5846 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/UI/AuctionWrapContentGroup.cs @@ -0,0 +1,62 @@ +using System; +using UILib; +using UnityEngine; + +namespace XMainClient.UI +{ + internal class AuctionWrapContentGroup + { + public int rowLines + { + get + { + return this.m_itemWrapContent.widthDimension; + } + } + + public int maxCount + { + get + { + return this.m_itemWrapContent.maxItemCount; + } + } + + public bool Active + { + get + { + return this.m_active; + } + } + + private IXUIScrollView m_itemScrollView; + + private IXUIWrapContent m_itemWrapContent; + + private Transform m_curTransform; + + private bool m_active = false; + + public void SetAuctionWrapContentTemp(Transform temp, WrapItemUpdateEventHandler handler) + { + this.m_curTransform = temp; + this.m_itemScrollView = (temp.gameObject.GetComponent("XUIScrollView") as IXUIScrollView); + this.m_itemWrapContent = (temp.transform.Find("Table").GetComponent("XUIWrapContent") as IXUIWrapContent); + this.m_itemWrapContent.RegisterItemUpdateEventHandler(handler); + } + + public void SetWrapContentSize(int listSize) + { + listSize = ((listSize % 2 == 1) ? (listSize + 1) : listSize); + this.m_itemWrapContent.SetContentCount(listSize, false); + this.m_itemScrollView.ResetPosition(); + } + + public void SetVisible(bool active) + { + this.m_active = active; + this.m_curTransform.gameObject.SetActive(active); + } + } +} -- cgit v1.1-26-g67d0