bingo 项目提交
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
using BingoBrain.Core;
|
||||
|
||||
namespace BingoBrain
|
||||
{
|
||||
public class StarRewardCtrl : BaseCtrl
|
||||
{
|
||||
public static StarRewardCtrl Instance { get; private set; }
|
||||
|
||||
private StarRewardModel model;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
Instance = this;
|
||||
//model = ModuleManager.Instance..GetModel(ModelConst.StarRewardModel) as StarRewardModel;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
Instance = null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bab3de57e00c0481f9aa217034beaacb
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,23 @@
|
||||
using BingoBrain.Core;
|
||||
|
||||
namespace BingoBrain
|
||||
{
|
||||
public class StarRewardModel : BaseModel
|
||||
{
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnReset()
|
||||
{
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: aa5642a70622845cfb922eb7de5ccd41
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,164 @@
|
||||
using System;
|
||||
using BingoBrain.Core;
|
||||
using BingoBrain.HotFix;
|
||||
using DG.Tweening;
|
||||
using FGUI.ACommon;
|
||||
using Spine.Unity;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BingoBrain
|
||||
{
|
||||
public class StarRewardUI : BaseUI
|
||||
{
|
||||
private StarRewardUICtrl ctrl;
|
||||
private StarRewardModel model;
|
||||
private FGUI.JRewardPop.com_StarReward ui;
|
||||
|
||||
public StarRewardUI(StarRewardUICtrl ctrl) : base(ctrl)
|
||||
{
|
||||
uiName = UIConst.StarRewardUI;
|
||||
this.ctrl = ctrl;
|
||||
}
|
||||
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
uiInfo.packageName = "JRewardPop";
|
||||
uiInfo.assetName = "com_StarReward";
|
||||
uiInfo.layerType = UILayerType.Popup;
|
||||
uiInfo.isNeedOpenAnim = false;
|
||||
uiInfo.isNeedCloseAnim = false;
|
||||
uiInfo.isNeedUIMask = true;
|
||||
}
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.StarRewardModel) as StarRewardModel;
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
CloseCb?.Invoke();
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as FGUI.JRewardPop.com_StarReward;
|
||||
}
|
||||
private bool is_three = false;
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
if (args != null && (bool)args) is_three = true;
|
||||
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()
|
||||
{
|
||||
|
||||
if (Screen.safeArea.y != 0)
|
||||
{//刘海屏
|
||||
ui.reward_end.y += Screen.safeArea.y;
|
||||
}
|
||||
decimal cash = CardEntity.GetSumToType(CardPropType.cash);
|
||||
if (is_three) cash = CardEntity.GetSumToType(CardPropType.cashx3);
|
||||
ui.cash_text.text = cash.ToString();
|
||||
Out102 item = GameHelper.GetDynamicVersion_Cash();
|
||||
ui.rate_text.text = "UP TO+" + item.cashmultiple + "00%";
|
||||
ui.btn_adget.title = "$" + cash * item.cashmultiple;
|
||||
ui.btn_get.SetClick(() =>
|
||||
{
|
||||
CheckReward(cash / 10);
|
||||
DOVirtual.DelayedCall(1.7f, () =>
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(SkinInfo.StarRewardUI_Close);
|
||||
GameHelper.ShowInterstitial("interstitial_skipAd");
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
ui.btn_adget.SetClick(() =>
|
||||
{
|
||||
GameHelper.GetVideo("reward_fly", isCompleted =>
|
||||
{
|
||||
if (isCompleted)
|
||||
{
|
||||
CheckReward(cash * item.cashmultiple);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
FX.Instance.SetFx<SkeletonAnimation>(ui.spine_parent, Fx_Type.spine_starreward_bg, sk =>
|
||||
{
|
||||
SkeletonAnimation cardSpine1 = sk;
|
||||
NAAVsa.PlayAnim(cardSpine1, "b2", true);
|
||||
|
||||
|
||||
// NAAVsa.AddCompleteEvent(cardSpine, OnChangeCardFinish);
|
||||
// OnChangeCardFinish(null);
|
||||
}, CloseCb);
|
||||
FX.Instance.SetFx<SkeletonAnimation>(ui.spine_parent, Fx_Type.spine_starreward_bg, sk =>
|
||||
{
|
||||
SkeletonAnimation cardSpine = sk;
|
||||
NAAVsa.PlayAnim(cardSpine, "b", false);
|
||||
|
||||
|
||||
// NAAVsa.AddCompleteEvent(cardSpine, OnChangeCardFinish);
|
||||
// OnChangeCardFinish(null);
|
||||
}, CloseCb);
|
||||
|
||||
|
||||
|
||||
}
|
||||
private Action CloseCb;
|
||||
|
||||
private void CheckReward(decimal cash)
|
||||
{
|
||||
var startPot = GameHelper.GetUICenterPosition(ui.cash_text);
|
||||
var endPos = GameHelper.GetUICenterPosition(ui.reward_end);
|
||||
var rewardData = new RewardData
|
||||
{
|
||||
displayType = RewardDisplayType.RewardFly | RewardDisplayType.ValueChange
|
||||
};
|
||||
var rewardSingleData = new Goda(101, cash, RewardOrigin.Play)
|
||||
{
|
||||
startPosition = startPot,
|
||||
endPosition = endPos,
|
||||
|
||||
};
|
||||
rewardSingleData.id = 102;
|
||||
rewardData.AddReward(rewardSingleData);
|
||||
GameDispatcher.Instance.Dispatch(BingoInfo.GetReward, rewardData);
|
||||
ui.btn_get.SetClick(() => { });
|
||||
ui.btn_adget.SetClick(() => { });
|
||||
DOVirtual.DelayedCall(1.7f, () =>
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(SkinInfo.StarRewardUI_Close);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 46306b39553e1426b80ac7575e0f9428
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,74 @@
|
||||
using BingoBrain.Core;
|
||||
using BingoBrain.HotFix;
|
||||
|
||||
namespace BingoBrain
|
||||
{
|
||||
public class StarRewardUICtrl : BaseUICtrl
|
||||
{
|
||||
private StarRewardUI ui;
|
||||
private StarRewardModel model;
|
||||
|
||||
private uint openUIMsg = SkinInfo.StarRewardUI_Open;
|
||||
private uint closeUIMsg = SkinInfo.StarRewardUI_Close;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.StarRewardModel) as StarRewardModel;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OpenUI(object args = null)
|
||||
{
|
||||
if (ui == null)
|
||||
{
|
||||
ui = new StarRewardUI(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);
|
||||
}
|
||||
|
||||
protected override void AddServerListener()
|
||||
{
|
||||
|
||||
}
|
||||
protected override void RemoveServerListener()
|
||||
{
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1360b602def8f47778c2b41184a0ad41
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user