summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/UILib/XUIObjectBase.cs
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-01-27 14:15:08 +0800
committerchai <chaifix@163.com>2021-01-27 14:15:08 +0800
commit1fe4ffba72f56ccc6a89d1896142425c666887d4 (patch)
treee469b6fea9454938d3a26444982be4b25de37103 /Client/Assets/Scripts/UILib/XUIObjectBase.cs
parent310103405588040c7bc777c802273556343cae92 (diff)
+UILib 反编译
Diffstat (limited to 'Client/Assets/Scripts/UILib/XUIObjectBase.cs')
-rw-r--r--Client/Assets/Scripts/UILib/XUIObjectBase.cs133
1 files changed, 133 insertions, 0 deletions
diff --git a/Client/Assets/Scripts/UILib/XUIObjectBase.cs b/Client/Assets/Scripts/UILib/XUIObjectBase.cs
new file mode 100644
index 00000000..8744f6bb
--- /dev/null
+++ b/Client/Assets/Scripts/UILib/XUIObjectBase.cs
@@ -0,0 +1,133 @@
+using System;
+using UILib;
+using UnityEngine;
+
+public abstract class XUIObjectBase : MonoBehaviour, IXUIObject
+{
+ public virtual IXUIObject parent
+ {
+ get
+ {
+ return this.m_parent;
+ }
+ set
+ {
+ this.m_parent = value;
+ }
+ }
+
+ public ulong ID
+ {
+ get
+ {
+ return this.m_id;
+ }
+ set
+ {
+ this.m_id = value;
+ }
+ }
+
+ public bool Exculsive
+ {
+ get
+ {
+ return this.m_bExculsive;
+ }
+ set
+ {
+ this.m_bExculsive = value;
+ }
+ }
+
+ private IXUIObject m_parent = null;
+
+ private ulong m_id;
+
+ private bool m_bExculsive = false;
+
+ public bool IsVisible()
+ {
+ return base.gameObject.activeInHierarchy;
+ }
+
+ public virtual void SetVisible(bool bVisible)
+ {
+ base.gameObject.SetActive(bVisible);
+ }
+
+ public virtual void OnFocus()
+ {
+ bool flag = this.parent != null;
+ if (flag)
+ {
+ this.parent.OnFocus();
+ }
+ }
+
+ public IXUIObject GetUIObject(string strName)
+ {
+ Transform transform = base.transform.Find(strName);
+ bool flag = null != transform;
+ IXUIObject result;
+ if (flag)
+ {
+ result = transform.GetComponent<XUIObjectBase>();
+ }
+ else
+ {
+ result = null;
+ }
+ return result;
+ }
+
+ public virtual void Highlight(bool bTrue)
+ {
+ }
+
+ protected virtual void OnPress(bool isPressed)
+ {
+ this.OnFocus();
+ }
+
+ protected virtual void OnDrag(Vector2 delta)
+ {
+ this.OnFocus();
+ }
+
+ public virtual void Init()
+ {
+ }
+
+ protected virtual void OnAwake()
+ {
+ }
+
+ protected virtual void OnStart()
+ {
+ }
+
+ protected virtual void OnUpdate()
+ {
+ }
+
+ private void Awake()
+ {
+ this.OnAwake();
+ }
+
+ private void Start()
+ {
+ this.OnStart();
+ }
+
+
+
+ GameObject IXUIObject.gameObject
+ {
+ get
+ {
+ return base.gameObject;
+ }
+ }
+}