bingo 项目提交
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using BingoBrain.Core;
|
||||
|
||||
using BingoBrain;
|
||||
|
||||
namespace BingoBrain
|
||||
{
|
||||
public class BuyslotCtrl : BaseCtrl
|
||||
{
|
||||
public static BuyslotCtrl Instance { get; private set; }
|
||||
|
||||
private BuyslotModel model;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
Instance = this;
|
||||
//model = ModuleManager.Instance..GetModel(ModelConst.BuyslotModel) as BuyslotModel;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
Instance = null;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 消息
|
||||
protected override void AddListener()
|
||||
{
|
||||
|
||||
}
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected override void AddServerListener()
|
||||
{
|
||||
|
||||
}
|
||||
protected override void RemoveServerListener()
|
||||
{
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b6058e09514454ec394a1478f2775964
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,48 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using BingoBrain.Core;
|
||||
|
||||
|
||||
namespace BingoBrain
|
||||
{
|
||||
public class BuyslotModel : BaseModel
|
||||
{
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnReset()
|
||||
{
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 读取数据
|
||||
protected override void OnReadData()
|
||||
{
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 本地存储
|
||||
protected override void WriteLocalStorage()
|
||||
{
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 消息
|
||||
protected override void AddListener()
|
||||
{
|
||||
|
||||
}
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1b0a4fbab97e64d5b982896192bb6483
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,182 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
using FairyGUI;
|
||||
using BingoBrain.Core;
|
||||
|
||||
using BingoBrain;
|
||||
using FGUI.G006_menu_animal;
|
||||
using FGUI.Common_animal;
|
||||
using System;
|
||||
|
||||
namespace BingoBrain
|
||||
{
|
||||
public class BuyslotUI : BaseUI
|
||||
{
|
||||
private BuyslotUICtrl ctrl;
|
||||
private BuyslotModel model;
|
||||
private FGUI.G006_menu_animal.com_buyslot ui;
|
||||
|
||||
public BuyslotUI(BuyslotUICtrl ctrl) : base(ctrl)
|
||||
{
|
||||
uiName = UIConst.BuyslotUI;
|
||||
this.ctrl = ctrl;
|
||||
}
|
||||
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
uiInfo.packageName = "G006_menu_animal";
|
||||
uiInfo.assetName = "com_buyslot";
|
||||
uiInfo.layerType = UILayerType.Popup;
|
||||
uiInfo.isNeedOpenAnim = false;
|
||||
uiInfo.isNeedCloseAnim = false;
|
||||
uiInfo.isNeedUIMask = true;
|
||||
}
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.BuyslotModel) as BuyslotModel;
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
GameHelper.showGameUI = true;
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as FGUI.G006_menu_animal.com_buyslot;
|
||||
}
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
InitView();
|
||||
GameHelper.showGameUI = false;
|
||||
NetworkKit.BuriedPoint(BuriedPointEvent.Apple_pay_event,BuriedPointEvent.buy_one_show,1);
|
||||
}
|
||||
|
||||
protected override void OnOpen(object args)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnHide()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDisplay(object args)
|
||||
{
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 消息
|
||||
protected override void AddListener()
|
||||
{
|
||||
GameDispatcher.Instance.AddListener(GameMsg.apple_pay_success, pay_success);
|
||||
Hall.Instance.UpdateSecondEvent += InitView;
|
||||
}
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
GameDispatcher.Instance.RemoveListener(GameMsg.apple_pay_success, pay_success);
|
||||
Hall.Instance.UpdateSecondEvent -= InitView;
|
||||
}
|
||||
#endregion
|
||||
void pay_success(object str)
|
||||
{
|
||||
string type = (string)str;
|
||||
|
||||
if (type == PurchasingManager.buy_one)
|
||||
{
|
||||
// UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.BuyslotUI_Close);
|
||||
// SaveData.GetSaveobject().have_slot = true;
|
||||
// SaveData.saveDataFunc();
|
||||
// GameDispatcher.Instance.Dispatch(GameMsg.Slot_refresh);
|
||||
CtrlCloseUI();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
//初始化页面逻辑
|
||||
private void InitView()
|
||||
{
|
||||
ui.btn_close.SetClick(CtrlCloseUI);
|
||||
|
||||
if (!GameHelper.IsAdModelOfPay()){
|
||||
ui.pay_type.selectedIndex = 1;
|
||||
if (GameHelper.IsGiftSwitch() && ConfigSystem.GetConfig<CommonModel>().PiggyBankSwitch == 1) (ui.btn_max_pay.GetChild("img_saveingpot") as GImage).visible = true;
|
||||
|
||||
decimal price = (decimal)GameHelper.GetCommonModel().addspace2;
|
||||
ui.btn_max_pay.title = GameHelper.Get102Str(price);
|
||||
ui.btn_max_pay.SetClick(() => {
|
||||
MaxPayClass maxPayData = new()
|
||||
{
|
||||
amount = (int)Math.Round(price * 100),
|
||||
sku = MaxPayManager.buy_one,
|
||||
currency = "USD"
|
||||
};
|
||||
MaxPayManager.Instance.Buy(maxPayData);
|
||||
});
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
ui.pay_type.selectedIndex = 0;
|
||||
|
||||
ui.text_have.text = "Owner ADs:" + SaveData.GetSaveobject().look_ad_numbers;
|
||||
ui.need_text.text = "need " + ConfigSystem.GetConfig<CommonModel>().addspace + " ADs";
|
||||
|
||||
|
||||
btn_green btn_buy = ui.btn_buy as btn_green;
|
||||
btn_buy.img_saveingpot.visible = false;
|
||||
if (SaveData.GetSaveobject().look_ad_numbers >= ConfigSystem.GetConfig<CommonModel>().addspace)
|
||||
{
|
||||
btn_buy.state.selectedIndex = 1;
|
||||
btn_buy.cooldown.selectedIndex = 0;
|
||||
ui.btn_buy.SetClick(() =>
|
||||
{
|
||||
ApplePayClass test = new ApplePayClass()
|
||||
{
|
||||
|
||||
sku = PurchasingManager.buy_one,
|
||||
|
||||
};
|
||||
SaveData.GetSaveobject().look_ad_numbers -= (int)ConfigSystem.GetConfig<CommonModel>().addspace;
|
||||
PurchasingManager.Instance.Purchase(PurchasingManager.buy_one, test);
|
||||
NetworkKit.BuriedPoint(BuriedPointEvent.Apple_pay_event, BuriedPointEvent.buy_one_success, 1);
|
||||
});
|
||||
}
|
||||
else if (SaveData.GetSaveobject().look_ad_time > GameHelper.GetNowTime())
|
||||
{
|
||||
btn_buy.state.selectedIndex = 0;
|
||||
btn_buy.cooldown.selectedIndex = 1;
|
||||
btn_buy.text = GameHelper.TimeFormat(SaveData.GetSaveobject().look_ad_time - Convert.ToInt32(GameHelper.GetNowTime()), CountDownType.Hour);
|
||||
btn_buy.SetClick(() =>
|
||||
{
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
btn_buy.state.selectedIndex = 0;
|
||||
btn_buy.cooldown.selectedIndex = 0;
|
||||
btn_buy.text = "Watch AD";
|
||||
if (GameHelper.IsGiftSwitch() && ConfigSystem.GetConfig<CommonModel>().PiggyBankSwitch == 1) btn_buy.img_saveingpot.visible = true;
|
||||
btn_buy.SetClick(() =>
|
||||
{
|
||||
GameHelper.ShowVideoAd("Pass", (issuccess) =>
|
||||
{
|
||||
if (issuccess)
|
||||
{
|
||||
SaveData.GetSaveobject().look_ad_time = (int)GameHelper.GetNowTime() + GameHelper.GetCommonModel().exchangeCD;
|
||||
InitView();
|
||||
|
||||
}
|
||||
});
|
||||
NetworkKit.BuriedPoint(BuriedPointEvent.Apple_pay_event, BuriedPointEvent.buy_one_click, 1);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 40b42d370a2c34db89da3decb4b3ba0d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,77 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using BingoBrain.Core;
|
||||
|
||||
using BingoBrain;
|
||||
|
||||
namespace BingoBrain
|
||||
{
|
||||
public class BuyslotUICtrl : BaseUICtrl
|
||||
{
|
||||
private BuyslotUI ui;
|
||||
private BuyslotModel model;
|
||||
|
||||
private uint openUIMsg = UICtrlMsg.BuyslotUI_Open;
|
||||
private uint closeUIMsg = UICtrlMsg.BuyslotUI_Close;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.BuyslotModel) as BuyslotModel;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OpenUI(object args = null)
|
||||
{
|
||||
if (ui == null)
|
||||
{
|
||||
ui = new BuyslotUI(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: 4c4feca1f3dc94e0291dbe534b773067
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user