using BingoBrain.Core;

namespace BingoBrain
{
    public class PropInfoUI : BaseUI
    {
        private PropInfoUICtrl ctrl;
        private PropInfoModel model;
        private FGUI.JBingoPlay.com_propInfo ui;

        public PropInfoUI(PropInfoUICtrl ctrl) : base(ctrl)
        {
            uiName = UIConst.PropInfoUI;
            this.ctrl = ctrl;
        }

        protected override void SetUIInfo(UIInfo uiInfo)
        {
            uiInfo.packageName = "JBingoPlay";
            uiInfo.assetName = "com_propInfo";
            uiInfo.layerType = UILayerType.Popup;
            uiInfo.isNeedOpenAnim = true;
            uiInfo.isNeedCloseAnim = true;
            uiInfo.isNeedUIMask = true;
        }

        #region 生命周期

        protected override void OnInit()
        {
        }

        protected override void OnClose()
        {
            ui?.FadeOut();
        }

        protected override void OnBind()
        {
            ui = baseUI as FGUI.JBingoPlay.com_propInfo;
        }

        protected override void OnOpenBefore(object args)
        {
            ui.closeButton.SetClick(CtrlCloseUI);
        }

        protected override void OnOpen(object args)
        {
            ui?.FadeIn();
        }

        #endregion
    }
}