97 lines
2.3 KiB
C#
97 lines
2.3 KiB
C#
|
|
using FGUI.ZM_Common_01;
|
|
using UnityEngine;
|
|
using FairyGUI;
|
|
|
|
namespace TowerClimberChronicles
|
|
{
|
|
public class GameAddTimeUI : BaseUI
|
|
{
|
|
private GameAddTimeUICtrl ctrl;
|
|
private GameAddTimeModel model;
|
|
private FGUI.ZM_Game_04.com_addtime ui;
|
|
|
|
public GameAddTimeUI(GameAddTimeUICtrl ctrl) : base(ctrl)
|
|
{
|
|
uiName = UIConst.GameAddTimeUI;
|
|
this.ctrl = ctrl;
|
|
}
|
|
|
|
protected override void SetUIInfo(UIInfo uiInfo)
|
|
{
|
|
uiInfo.packageName = "ZM_Game_04";
|
|
uiInfo.assetName = "com_addtime";
|
|
uiInfo.layerType = UILayerType.Normal;
|
|
uiInfo.isNeedOpenAnim = false;
|
|
uiInfo.isNeedCloseAnim = false;
|
|
uiInfo.isNeedUIMask = true;
|
|
}
|
|
|
|
#region 生命周期
|
|
protected override void OnInit()
|
|
{
|
|
//model = ModuleManager.Instance.GetModel(ModelConst.GameAddTimeModel) as GameAddTimeModel;
|
|
}
|
|
|
|
protected override void OnClose()
|
|
{
|
|
}
|
|
|
|
protected override void OnBind()
|
|
{
|
|
ui = baseUI as FGUI.ZM_Game_04.com_addtime;
|
|
}
|
|
|
|
protected override void OnOpenBefore(object args)
|
|
{
|
|
InitView();
|
|
}
|
|
|
|
protected override void OnOpen(object args)
|
|
{
|
|
}
|
|
|
|
protected override void OnHide()
|
|
{
|
|
}
|
|
|
|
protected override void OnDisplay(object args)
|
|
{
|
|
}
|
|
#endregion
|
|
|
|
#region 消息
|
|
protected override void AddListener()
|
|
{
|
|
|
|
}
|
|
protected override void RemoveListener()
|
|
{
|
|
|
|
}
|
|
#endregion
|
|
|
|
//初始化页面逻辑
|
|
private void InitView()
|
|
{
|
|
ui.btn_ad.SetClick(() =>
|
|
{
|
|
GameHelper.ShowVideoAd("AddTime", (issuccess) =>
|
|
{
|
|
if (issuccess)
|
|
{
|
|
GameDispatcher.Instance.Dispatch(GameMsg.GameAddTime);
|
|
CtrlCloseUI();
|
|
}
|
|
});
|
|
});
|
|
|
|
ui.btn_close.SetClick(() =>
|
|
{
|
|
uiCtrlDispatcher.Dispatch(UICtrlMsg.GameEndUI_Open, false);
|
|
CtrlCloseUI();
|
|
});
|
|
|
|
}
|
|
}
|
|
} |