115 lines
3.2 KiB
C#
115 lines
3.2 KiB
C#
|
|
using System.Collections;
|
||
|
|
using System.Collections.Generic;
|
||
|
|
using UnityEngine;
|
||
|
|
|
||
|
|
using FairyGUI;
|
||
|
|
using BingoBrain.Core;
|
||
|
|
|
||
|
|
using BingoBrain;
|
||
|
|
using FGUI.G009_video_animal;
|
||
|
|
using DG.Tweening;
|
||
|
|
using Spine.Unity;
|
||
|
|
using System;
|
||
|
|
|
||
|
|
namespace BingoBrain
|
||
|
|
{
|
||
|
|
public class GetTaskRewardUI : BaseUI
|
||
|
|
{
|
||
|
|
private GetTaskRewardUICtrl ctrl;
|
||
|
|
private GetTaskRewardModel model;
|
||
|
|
private FGUI.G009_video_animal.com_gettaskreward ui;
|
||
|
|
|
||
|
|
public GetTaskRewardUI(GetTaskRewardUICtrl ctrl) : base(ctrl)
|
||
|
|
{
|
||
|
|
uiName = UIConst.GetTaskRewardUI;
|
||
|
|
this.ctrl = ctrl;
|
||
|
|
}
|
||
|
|
|
||
|
|
protected override void SetUIInfo(UIInfo uiInfo)
|
||
|
|
{
|
||
|
|
uiInfo.packageName = "G009_video_animal";
|
||
|
|
uiInfo.assetName = "com_gettaskreward";
|
||
|
|
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.G009_video_animal.com_gettaskreward;
|
||
|
|
}
|
||
|
|
private Action closeCallback;
|
||
|
|
protected override void OnOpenBefore(object args)
|
||
|
|
{
|
||
|
|
// var sk = FX.Instance.SetFx<SkeletonAnimation>(baseUI.GetChild("bg_parent") as GGraph, Fx_Type.fx_win, ref closeCallback);
|
||
|
|
// sk.state.SetAnimation(0, "out", true);
|
||
|
|
InitView();
|
||
|
|
Debug.Log(args);
|
||
|
|
|
||
|
|
int number = (int)args;
|
||
|
|
ui.money_text.text = number.ToString();
|
||
|
|
ui.btn_claim.SetClick(() =>
|
||
|
|
{
|
||
|
|
GameDispatcher.Instance.Dispatch(GameMsg.GetTaskReward, false);
|
||
|
|
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.GetTaskRewardUI_Close);
|
||
|
|
GameHelper.addInterAdnumber();
|
||
|
|
});
|
||
|
|
ui.btn_adclaim.SetClick(() =>
|
||
|
|
{
|
||
|
|
GameHelper.ShowVideoAd("reward_lobby", isSuccess =>
|
||
|
|
{
|
||
|
|
if (isSuccess)
|
||
|
|
{
|
||
|
|
GameDispatcher.Instance.Dispatch(GameMsg.GetTaskReward, true);
|
||
|
|
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.GetTaskRewardUI_Close);
|
||
|
|
}
|
||
|
|
});
|
||
|
|
|
||
|
|
});
|
||
|
|
if (GameHelper.IsGiftSwitch() && ConfigSystem.GetConfig<CommonModel>().PiggyBankSwitch == 1) (ui.btn_adclaim.GetChild("img_saveingpot") as GImage).visible = true;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
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()
|
||
|
|
{
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|