From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../XMainClient/UI/UICommon/DlgBehaviourBase.cs | 130 +++++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/UI/UICommon/DlgBehaviourBase.cs (limited to 'Client/Assets/Scripts/XMainClient/UI/UICommon/DlgBehaviourBase.cs') diff --git a/Client/Assets/Scripts/XMainClient/UI/UICommon/DlgBehaviourBase.cs b/Client/Assets/Scripts/XMainClient/UI/UICommon/DlgBehaviourBase.cs new file mode 100644 index 00000000..82af93d4 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/UI/UICommon/DlgBehaviourBase.cs @@ -0,0 +1,130 @@ +using System; +using UILib; +using UnityEngine; + +namespace XMainClient.UI.UICommon +{ + public class DlgBehaviourBase : MonoBehaviour, IXUIBehaviour, IXUIObject + { + public IXUIObject parent + { + get + { + return null; + } + set + { + } + } + + 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; + } + } + + public IXUIDlg uiDlgInterface + { + get + { + return this.m_uiDlgInterface; + } + set + { + this.m_uiDlgInterface = value; + } + } + + public IXUIObject[] uiChilds + { + get + { + return this.m_uiChilds; + } + } + + private IXUIDlg m_uiDlgInterface = null; + + private IXUIObject[] m_uiChilds = null; + + private ulong m_id; + + private bool m_bExculsive = false; + + public bool IsVisible() + { + return base.gameObject.activeInHierarchy; + } + + public void SetVisible(bool bVisible) + { + base.gameObject.SetActive(bVisible); + } + + public IXUIObject GetUIObject(string strName) + { + Transform transform = base.transform.Find(strName); + bool flag = null != transform; + IXUIObject result; + if (flag) + { + result = transform.GetComponent(); + } + else + { + result = null; + } + return result; + } + + public void OnPress() + { + this.OnFocus(); + } + + public void OnFocus() + { + } + + public virtual void Init() + { + IXUIObject[] componentsInChildren = base.GetComponentsInChildren(); + this.m_uiChilds = componentsInChildren; + for (int i = 0; i < this.m_uiChilds.Length; i++) + { + XUIObjectBase xuiobjectBase = this.m_uiChilds[i] as XUIObjectBase; + xuiobjectBase.Init(); + } + } + + public virtual void Highlight(bool bTrue) + { + } + + GameObject IXUIObject.gameObject + { + get + { + return base.gameObject; + } + } + } +} -- cgit v1.1-26-g67d0