112 lines
3.2 KiB
C#
112 lines
3.2 KiB
C#
using UnityEngine;
|
|
using FairyGUI;
|
|
using Spine.Unity;
|
|
using System;
|
|
|
|
namespace ZooMatch
|
|
{
|
|
public class GetTaskRewardUI : BaseUI
|
|
{
|
|
private GetTaskRewardUICtrl ctrl;
|
|
private GetTaskRewardModel model;
|
|
private FGUI.ZM_Tasks_13.com_task_reward ui;
|
|
|
|
public GetTaskRewardUI(GetTaskRewardUICtrl ctrl) : base(ctrl)
|
|
{
|
|
uiName = UIConst.GetTaskRewardUI;
|
|
this.ctrl = ctrl;
|
|
}
|
|
|
|
protected override void SetUIInfo(UIInfo uiInfo)
|
|
{
|
|
uiInfo.packageName = "ZM_Tasks_13";
|
|
uiInfo.assetName = "com_task_reward";
|
|
uiInfo.layerType = UILayerType.Popup;
|
|
uiInfo.isNeedOpenAnim = false;
|
|
uiInfo.isNeedCloseAnim = false;
|
|
uiInfo.isNeedUIMask = true;
|
|
}
|
|
|
|
#region 生命周期
|
|
protected override void OnInit()
|
|
{
|
|
//model = ModuleManager.Instance.GetModel(ModelConst.GetTaskRewardModel) as GetTaskRewardModel;
|
|
}
|
|
|
|
protected override void OnClose()
|
|
{
|
|
closeCallback?.Invoke();
|
|
}
|
|
|
|
protected override void OnBind()
|
|
{
|
|
ui = baseUI as FGUI.ZM_Tasks_13.com_task_reward;
|
|
}
|
|
private Action closeCallback;
|
|
protected override void OnOpenBefore(object args)
|
|
{
|
|
|
|
var sk = FXManager.Instance.SetFx<SkeletonAnimation>(baseUI.GetChild("bg_parent") as GGraph, Fx_Type.fx_win, ref closeCallback);
|
|
sk.state.SetAnimation(0, "out", true);
|
|
if (GameHelper.IsGiftSwitch() && ConfigSystem.GetConfig<CommonModel>().PiggyBankSwitch == 1) (ui.btn_mult.GetChild("img_saveingpot") as GImage).visible = true;
|
|
InitView();
|
|
// Debug.Log(args);
|
|
int number = (int)args;
|
|
ui.text_award.text = number.ToString();
|
|
ui.btn_claim.SetClick(() =>
|
|
{
|
|
GameHelper.addInterAdnumber();
|
|
GameDispatcher.Instance.Dispatch(GameMsg.GetTaskReward, false);
|
|
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.GetTaskRewardUI_Close);
|
|
});
|
|
ui.btn_mult.SetClick(() =>
|
|
{
|
|
GameHelper.ShowVideoAd("reward_lobby", isSuccess =>
|
|
{
|
|
if (isSuccess)
|
|
{
|
|
GameDispatcher.Instance.Dispatch(GameMsg.GetTaskReward, true);
|
|
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.GetTaskRewardUI_Close);
|
|
}
|
|
});
|
|
|
|
});
|
|
|
|
if (AudioManager.Instance.IsOpenEffect)
|
|
{
|
|
AudioManager.Instance.PlayDynamicEffect(AudioConst.Victoriously);
|
|
}
|
|
}
|
|
|
|
|
|
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()
|
|
{
|
|
|
|
}
|
|
}
|
|
} |