using BingoBrain.Core;
using FGUI.JSettings;

namespace BingoBrain
{
    public class BingoWhatUI : BaseUI
    {
        private BingoWhatUICtrl ctrl;
        private BingoWhatModel model;
        private com_howto ui;

        public BingoWhatUI(BingoWhatUICtrl ctrl) : base(ctrl)
        {
            uiName = UIConst.BingoWhatUI;
            this.ctrl = ctrl;
        }

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

        #region 生命周期

        protected override void OnInit()
        {
        }

        protected override void OnClose()
        {
        }

        protected override void OnBind()
        {
            ui = baseUI as com_howto;
        }

        protected override void OnOpenBefore(object args)
        {
            ui.closeButton.onClick.Set(CtrlCloseUI);
            Audio.Instance.PlayDynamicEffect("pop_open");
        }

        protected override void OnOpen(object args)
        {
        }

        #endregion
    }
}