using System; using UnityEngine; public class BaseUI : AbstractController { protected string m_UIName = string.Empty; private Transform m_Transform; private GameObject m_Go; public string UIName { get { return this.m_UIName; } set { this.m_UIName = value; } } public Transform CacheTransform { get { if (this.m_Transform == null) { this.m_Transform = base.transform; } return this.m_Transform; } } public GameObject CacheGameObject { get { if (this.m_Go == null) { this.m_Go = base.gameObject; } return this.m_Go; } } public void Show(object param = null) { this.CacheGameObject.SetActive(true); this.OnShow(param); } public void Show(WarningUI.OnYesClick onYesClick, object param = null) { this.CacheGameObject.SetActive(true); this.OnShow(onYesClick, param); } public void Show(WarningUI.OnYesClick onYesClick, WarningUI.OnNoClick onNoClick, object param = null) { this.CacheGameObject.SetActive(true); this.OnShow(onYesClick, onNoClick, param); } public void Hide() { this.CacheGameObject.SetActive(false); this.OnHide(); } public bool IsShow() { return this.CacheGameObject.activeSelf; } private void Awake() { this.OnAwake(); } public void UIInit() { this.OnInit(); } protected virtual void OnShow(object param) { } protected virtual void OnShow(WarningUI.OnYesClick onYesClick, object param) { } protected virtual void OnShow(WarningUI.OnYesClick onYesClick, WarningUI.OnNoClick onNoClick, object param) { } protected virtual void OnHide() { } protected virtual void OnInit() { } protected virtual void OnAwake() { } protected virtual void OnDestroy() { } }