diff options
Diffstat (limited to 'Client/Assets/Scripts/UILib/XUIObjectBase.cs')
-rw-r--r-- | Client/Assets/Scripts/UILib/XUIObjectBase.cs | 133 |
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;
+ }
+ }
+}
|