bingo 项目提交
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
using BingoBrain.Core;
|
||||
|
||||
namespace BingoBrain
|
||||
{
|
||||
public class GodPleCtrl : BaseCtrl
|
||||
{
|
||||
public static GodPleCtrl Instance { get; private set; }
|
||||
|
||||
private GodPleModel model;
|
||||
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
Instance = this;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
Instance = null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 81d9d87d3c0dfa74bbb96e96b86d9cb5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,25 @@
|
||||
using BingoBrain.Core;
|
||||
|
||||
namespace BingoBrain
|
||||
{
|
||||
public class GodPleModel : BaseModel
|
||||
{
|
||||
public RewardData rewardInfo;
|
||||
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnReset()
|
||||
{
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1d9167aa46fc85a4a85c791a01284ddf
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,150 @@
|
||||
using System;
|
||||
using DG.Tweening;
|
||||
using BingoBrain.Core;
|
||||
using FGUI.JRewardPop;
|
||||
using DontConfuse;
|
||||
|
||||
namespace BingoBrain
|
||||
{
|
||||
public class GodPleUI : BaseUI
|
||||
{
|
||||
private GodPleUICtrl ctrl;
|
||||
private GodPleModel model;
|
||||
private com_reward ui;
|
||||
|
||||
private Action closeCallback;
|
||||
|
||||
public GodPleUI(GodPleUICtrl ctrl) : base(ctrl)
|
||||
{
|
||||
uiName = UIConst.GodPleUI;
|
||||
this.ctrl = ctrl;
|
||||
}
|
||||
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
uiInfo.packageName = "JRewardPop";
|
||||
uiInfo.assetName = "com_reward";
|
||||
uiInfo.layerType = UILayerType.Popup;
|
||||
uiInfo.isNeedOpenAnim = false;
|
||||
uiInfo.isNeedCloseAnim = false;
|
||||
uiInfo.isNeedUIMask = true;
|
||||
}
|
||||
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
model = ModuleBoardk.GetModel(ModelConst.GodPleModel) as GodPleModel;
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
if (UI.Instance.IsExistUI(UIConst.H5UI))
|
||||
{
|
||||
WebviewManager.Instance.SetDarkThough(true);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as com_reward;
|
||||
}
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
if (GameHelper.IsGiftSwitch()) ui.gift.selectedIndex = 1;
|
||||
if (args != null)
|
||||
{
|
||||
model.rewardInfo = (RewardData)args;
|
||||
}
|
||||
if (UI.Instance.IsExistUI(UIConst.H5UI))
|
||||
{
|
||||
WebviewManager.Instance.SetDarkThough(false);
|
||||
}
|
||||
InitView();
|
||||
}
|
||||
|
||||
protected override void OnOpen(object args)
|
||||
{
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
private void InitView()
|
||||
{
|
||||
DOVirtual.DelayedCall(0.10f, () =>
|
||||
{
|
||||
var piaodai = GameHelper.SetSpine("Effect.spine.fx_piaodai", "fx_piaodai", ui.fx_PiaoDai, "enter",
|
||||
false);
|
||||
DOVirtual.DelayedCall(0.8f, () => { piaodai.state.SetAnimation(0, "idle", true); });
|
||||
DOVirtual.DelayedCall(0.2f,
|
||||
() => { GameHelper.SetParticleSystem("Effect.sys.fx_lihua", "fx_lihua", ui.fx_lihua); });
|
||||
});
|
||||
|
||||
var rewardValue = model.rewardInfo.GetRewardDataList()[0].GetTotalValue();
|
||||
ui.text_num.text = $"+{GameHelper.Get102Str(rewardValue)}";
|
||||
|
||||
Out102 item = GameHelper.GetDynamicVersion_Cash();
|
||||
ui.rate_text.text = "UP TO+" + item.cashmultiple + "00%";
|
||||
ui.btn_collect.title = "Get " + (rewardValue * item.cashmultiple).ToString("0.00");
|
||||
|
||||
var isFree = model.rewardInfo.condition == RewardCondition.None;
|
||||
|
||||
if (ui.btn_collect is btn_collect btn_collect)
|
||||
{
|
||||
btn_collect.cont_state.selectedIndex = isFree ? btn_collect._State_free : btn_collect._State_video;
|
||||
}
|
||||
|
||||
|
||||
ui.btn_no.visible = false;
|
||||
|
||||
// if (!isFree)
|
||||
// {
|
||||
DOVirtual.DelayedCall(2, () => { ui.btn_no.visible = true; });
|
||||
|
||||
ui.btn_collect.SetClick(() =>
|
||||
{
|
||||
OnClickAdCollect(item.cashmultiple);
|
||||
});
|
||||
ui.btn_no.SetClick(() =>
|
||||
{
|
||||
OnClickCancel();
|
||||
});
|
||||
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// ui.btn_collect.SetClick(GetReward);
|
||||
// }
|
||||
}
|
||||
|
||||
private void OnClickAdCollect(int rate)
|
||||
{
|
||||
GameHelper.GetVideo("reward_playcash", isSuccess =>
|
||||
{
|
||||
if (isSuccess)
|
||||
{
|
||||
model.rewardInfo.GetRewardDataList()[0].value = model.rewardInfo.GetRewardDataList()[0].value * rate;
|
||||
GetReward();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void GetReward()
|
||||
{
|
||||
UsaSystem.GetReward(model.rewardInfo);
|
||||
CtrlCloseUI();
|
||||
}
|
||||
|
||||
private void OnClickCancel()
|
||||
{
|
||||
model.rewardInfo.GetRewardDataList()[0].value = model.rewardInfo.GetRewardDataList()[0].value / 10;
|
||||
UsaSystem.GetReward(model.rewardInfo);
|
||||
CtrlCloseUI();
|
||||
GameHelper.ShowInterstitial("interstitial_skipAd");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: afe487c604b345c42a4eb1b64ccf087d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,71 @@
|
||||
using BingoBrain.Core;
|
||||
using BingoBrain.HotFix;
|
||||
|
||||
namespace BingoBrain
|
||||
{
|
||||
public class GodPleUICtrl : BaseUICtrl
|
||||
{
|
||||
private GodPleUI ui;
|
||||
private GodPleModel model;
|
||||
|
||||
private uint openUIMsg = SkinInfo.GodPleUI_Open;
|
||||
private uint closeUIMsg = SkinInfo.GodPleUI_Close;
|
||||
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OpenUI(object args = null)
|
||||
{
|
||||
if (ui == null)
|
||||
{
|
||||
ui = new GodPleUI(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,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 251033e0809ba1c4888aea3dad2fe7d7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user