summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/UICommon/XUIPopupList.cs
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-01-25 14:28:30 +0800
committerchai <chaifix@163.com>2021-01-25 14:28:30 +0800
commit6eb915c129fc90c6f4c82ae097dd6ffad5239efc (patch)
tree7dd2be50edf41f36b60fac84696e731c13afe617 /Client/Assets/Scripts/UICommon/XUIPopupList.cs
+scripts
Diffstat (limited to 'Client/Assets/Scripts/UICommon/XUIPopupList.cs')
-rw-r--r--Client/Assets/Scripts/UICommon/XUIPopupList.cs47
1 files changed, 47 insertions, 0 deletions
diff --git a/Client/Assets/Scripts/UICommon/XUIPopupList.cs b/Client/Assets/Scripts/UICommon/XUIPopupList.cs
new file mode 100644
index 00000000..f78b6c01
--- /dev/null
+++ b/Client/Assets/Scripts/UICommon/XUIPopupList.cs
@@ -0,0 +1,47 @@
+using UILib;
+using UnityEngine;
+using System.Collections.Generic;
+
+public class XUIPopupList : XUIObject, IXUIPopupList
+{
+
+ protected override void OnAwake()
+ {
+ base.OnAwake();
+ m_uiPopupList = GetComponent<UIPopupList>();
+ if (null == m_uiPopupList)
+ {
+ Debug.LogError("null == m_uiPopupList");
+ }
+ }
+
+ public void SetOptionList(List<string> options)
+ {
+ m_uiPopupList.items = options;
+ }
+
+ public string value
+ {
+ get { return m_uiPopupList.value; }
+ set { m_uiPopupList.value = value; }
+ }
+
+ public int currentIndex
+ {
+ get
+ {
+ return m_uiPopupList.items.IndexOf(m_uiPopupList.value);
+ }
+ set
+ {
+ if(value >= m_uiPopupList.items.Count)
+ {
+ Debug.LogError("Index out of range. " + value);
+ return;
+ }
+ m_uiPopupList.value = m_uiPopupList.items[value];
+ }
+ }
+ private UIPopupList m_uiPopupList;
+}
+