AkiraPixelWind/Assets/Scripts/Main/UI/UIMgr/UIBase.cs

40 lines
640 B
C#
Raw Normal View History

2022-12-29 18:20:40 +08:00
using UnityEngine;
using UnityEngine.UI;
public class UIBase : MonoBehaviour {
public Button btnClose;
public object[] _InitRarams;
public virtual void Awake()
{
var tfBtnClose = transform.Find("btnClose");
if (tfBtnClose)
{
btnClose = transform.Find("btnClose").GetComponent<Button>();
btnClose.onClick.AddListener(Hide);
}
}
public virtual void Show(params object[] _params) {
_InitRarams = _params;
}
public virtual void Hide()
{
UIMgr.Instance.Hide(this);
}
public virtual void Close() {
UIMgr.Instance.CloseUI(this);
}
public virtual void SkipToTab(int _tabIdx)
{
}
}