bingo 项目提交
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
using BingoBrain.Core;
|
||||
|
||||
namespace BingoBrain
|
||||
{
|
||||
public class MoreCardCtrl : BaseCtrl
|
||||
{
|
||||
public static MoreCardCtrl Instance { get; private set; }
|
||||
|
||||
private MoreCardModel model;
|
||||
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
Instance = this;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
Instance = null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7410802b8eba401f9fcb6348dac4adc8
|
||||
timeCreated: 1679897452
|
||||
@@ -0,0 +1,25 @@
|
||||
using BingoBrain.Core;
|
||||
|
||||
namespace BingoBrain
|
||||
{
|
||||
public class MoreCardModel : BaseModel
|
||||
{
|
||||
public AdReward VO => GameHelper.GetConfig<AdRewardModel>().GetData("reward_addCard");
|
||||
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnReset()
|
||||
{
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3ed64b26749046258a515def749d4ccd
|
||||
timeCreated: 1679897452
|
||||
@@ -0,0 +1,73 @@
|
||||
using FairyGUI;
|
||||
using BingoBrain.Core;
|
||||
using FGUI.JBingoPlay;
|
||||
|
||||
namespace BingoBrain
|
||||
{
|
||||
public class MoreCardUI : BaseUI
|
||||
{
|
||||
private MoreCardUICtrl ctrl;
|
||||
private MoreCardModel model;
|
||||
private FGUI.JBingoPlay.com_morecard ui;
|
||||
|
||||
public MoreCardUI(MoreCardUICtrl ctrl) : base(ctrl)
|
||||
{
|
||||
uiName = UIConst.MoreCardUI;
|
||||
this.ctrl = ctrl;
|
||||
}
|
||||
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
uiInfo.packageName = "JBingoPlay";
|
||||
uiInfo.assetName = "com_morecard";
|
||||
uiInfo.layerType = UILayerType.Popup;
|
||||
uiInfo.isNeedOpenAnim = true;
|
||||
uiInfo.isNeedCloseAnim = true;
|
||||
uiInfo.isNeedUIMask = true;
|
||||
}
|
||||
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
model = ModuleBoardk.GetModel(ModelConst.MoreCardModel) as MoreCardModel;
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
ui?.FadeOut();
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as com_morecard;
|
||||
}
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
ui.btn_more.onClick.Set(BuyBtn);
|
||||
ui.closeButton.onClick.Set(CtrlCloseUI);
|
||||
Audio.Instance.PlayDynamicEffect("pop_open");
|
||||
}
|
||||
|
||||
private void BuyBtn(EventContext context)
|
||||
{
|
||||
GameHelper.GetVideo(model.VO.key, (isSuccess) =>
|
||||
{
|
||||
if (isSuccess)
|
||||
{
|
||||
GameHelper.GetRewardOnly(model.VO.reward, model.VO.rewardAmount, RewardOrigin.MoreCard);
|
||||
CtrlCloseUI();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected override void OnOpen(object args)
|
||||
{
|
||||
ui?.FadeIn();
|
||||
GameHelper.DelayedShowGObject(this, ui.closeButton);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2934185cc5b840989c990709f0692d39
|
||||
timeCreated: 1679897452
|
||||
@@ -0,0 +1,71 @@
|
||||
using BingoBrain.Core;
|
||||
using BingoBrain.HotFix;
|
||||
|
||||
namespace BingoBrain
|
||||
{
|
||||
public class MoreCardUICtrl : BaseUICtrl
|
||||
{
|
||||
private MoreCardUI ui;
|
||||
private MoreCardModel model;
|
||||
|
||||
private uint openUIMsg = SkinInfo.MoreCardUI_Open;
|
||||
private uint closeUIMsg = SkinInfo.MoreCardUI_Close;
|
||||
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OpenUI(object args = null)
|
||||
{
|
||||
if (ui == null)
|
||||
{
|
||||
ui = new MoreCardUI(this);
|
||||
ui.Open(args);
|
||||
}
|
||||
}
|
||||
|
||||
public override void CloseUI(object args = null)
|
||||
{
|
||||
if (ui != null && !ui.isClose)
|
||||
{
|
||||
ui.Close();
|
||||
}
|
||||
|
||||
ui = null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 消息
|
||||
|
||||
public override uint GetOpenUIMsg(string uiName)
|
||||
{
|
||||
return openUIMsg;
|
||||
}
|
||||
|
||||
public override uint GetCloseUIMsg(string uiName)
|
||||
{
|
||||
return closeUIMsg;
|
||||
}
|
||||
|
||||
protected override void AddListener()
|
||||
{
|
||||
uiCtrlDispatcher.AddListener(openUIMsg, OpenUI);
|
||||
uiCtrlDispatcher.AddListener(closeUIMsg, CloseUI);
|
||||
}
|
||||
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
uiCtrlDispatcher.RemoveListener(openUIMsg, OpenUI);
|
||||
uiCtrlDispatcher.RemoveListener(closeUIMsg, CloseUI);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2858e0bd80794183bd43ba49e8e98e05
|
||||
timeCreated: 1679897452
|
||||
Reference in New Issue
Block a user