From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- Client/Assets/Scripts/UICommon/XUIList.cs | 57 +++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 Client/Assets/Scripts/UICommon/XUIList.cs (limited to 'Client/Assets/Scripts/UICommon/XUIList.cs') diff --git a/Client/Assets/Scripts/UICommon/XUIList.cs b/Client/Assets/Scripts/UICommon/XUIList.cs new file mode 100644 index 00000000..9c25f7df --- /dev/null +++ b/Client/Assets/Scripts/UICommon/XUIList.cs @@ -0,0 +1,57 @@ +using UILib; +using UnityEngine; + +public class XUIList : XUIObject, IXUIList +{ + public UIRect _parent; + public void Refresh() + { + m_uiGrid.repositionNow = true; + //m_uiGrid.Reposition(); + } + + public void CloseList() + { + m_uiGrid.CloseList(); + } + + public void SetAnimateSmooth(bool b) + { + m_uiGrid.animateSmoothly = b; + } + public void RegisterRepositionHandle(OnAfterRepostion reposition) + { + onRepositionFinish = reposition; + } + + private void OnAfterReposition() + { + if (onRepositionFinish != null) + { + onRepositionFinish(); + } + } + public IUIRect GetParentUIRect() + { + return _parent; + } + public IUIPanel GetParentPanel() + { + return m_uiGrid.panel; + } + + protected override void OnAwake() + { + base.OnAwake(); + m_uiGrid = GetComponent(); + if (m_uiGrid != null) + m_uiGrid.onReposition = OnAfterReposition; + else + Debug.Log("no ngui grid component"); + } + + private UIGrid m_uiGrid; + + private OnAfterRepostion onRepositionFinish = null; + +} -- cgit v1.1-26-g67d0