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 SheepPlayCtrl : BaseCtrl
|
||||
{
|
||||
public static SheepPlayCtrl Instance { get; private set; }
|
||||
|
||||
private SheepPlayModel model;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
Instance = this;
|
||||
//model = ModuleManager.Instance..GetModel(ModelConst.SheepPlayModel) as SheepPlayModel;
|
||||
}
|
||||
|
||||
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: dccdf152f07be452bbd8727e8a8aa708
|
||||
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 SheepPlayModel : 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: eb3e7a6ac36b945dcb2b6b04634732d7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 901f044832e634fd69e12ec14f995ac7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,236 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using BingoBrain.Core;
|
||||
|
||||
using BingoBrain;
|
||||
using UnityEngine;
|
||||
using AppsFlyerSDK;
|
||||
|
||||
namespace BingoBrain
|
||||
{
|
||||
public class SheepPlayUICtrl : BaseUICtrl
|
||||
{
|
||||
private SheepPlayUI ui;
|
||||
private SheepPlayModel model;
|
||||
|
||||
private uint openUIMsg = UICtrlMsg.SheepPlayUI_Open;
|
||||
private uint closeUIMsg = UICtrlMsg.SheepPlayUI_Close;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.SheepPlayModel) as SheepPlayModel;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OpenUI(object args = null)
|
||||
{
|
||||
if (ui == null)
|
||||
{
|
||||
ui = new SheepPlayUI(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);
|
||||
GameDispatcher.Instance.AddListener(GameMsg.apple_pay_success, pay_success);
|
||||
}
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
uiCtrlDispatcher.RemoveListener(openUIMsg, OpenUI);
|
||||
uiCtrlDispatcher.RemoveListener(closeUIMsg, CloseUI);
|
||||
GameDispatcher.Instance.AddListener(GameMsg.apple_pay_success, pay_success);
|
||||
}
|
||||
|
||||
protected override void AddServerListener()
|
||||
{
|
||||
|
||||
}
|
||||
protected override void RemoveServerListener()
|
||||
{
|
||||
|
||||
}
|
||||
void pay_success(object str)
|
||||
{
|
||||
string type = (string)str;
|
||||
string purch_number = "";
|
||||
Debug.Log("jiantinggggggggggggggggggggggg");
|
||||
if (type.StartsWith("buy_gold"))
|
||||
{
|
||||
int startIndex = "buy_gold".Length;
|
||||
string suffix = type[startIndex..]; // 截取 "gold" 后的所有字符
|
||||
int suffix_num = int.Parse(suffix);
|
||||
List<Paidcoins> list = ConfigSystem.GetConfig<PaidcoinsModel>().dataList;
|
||||
purch_number = ConfigSystem.GetConfig<PaidcoinsModel>().dataList[suffix_num].Payment_amount.ToString();
|
||||
|
||||
//如果关闭了购买界面,则需要进行刷新金币
|
||||
if(!UI.Instance.IsExistUI(UIConst.BuygoldUI))
|
||||
{
|
||||
// GameHelper.AddGoldNumber(list[suffix_num].Actual_coins);
|
||||
// GameDispatcher.Instance.Dispatch(GameMsg.Gold_refresh);
|
||||
ui.GetCoinAnim(list[suffix_num].Actual_coins);
|
||||
}
|
||||
}
|
||||
else if (type == PurchasingManager.buy_one)
|
||||
{
|
||||
SaveData.GetSaveobject().have_slot = true;
|
||||
SaveData.saveDataFunc();
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.Slot_refresh);
|
||||
purch_number = ConfigSystem.GetConfig<CommonModel>().addspace.ToString();
|
||||
}
|
||||
else if (type == PurchasingManager.remove_ad)
|
||||
{
|
||||
SaveData.GetSaveobject().is_get_removead = true;
|
||||
SaveData.saveDataFunc();
|
||||
purch_number = ConfigSystem.GetConfig<PaidgiftModel>().dataList[1].Paid_price.ToString();
|
||||
ui?.setBtnAds();
|
||||
|
||||
//如果关闭了购买界面,则需要进行刷新金币
|
||||
if(!UI.Instance.IsExistUI(UIConst.PackrewardUI))
|
||||
{
|
||||
// PreferencesMgr.Instance.Currency101 += ConfigSystem.GetConfig<PaidgiftModel>().dataList[1].coins_quantity;
|
||||
// GameDispatcher.Instance.Dispatch(GameMsg.Gold_refresh);
|
||||
ui.GetCoinAnim(ConfigSystem.GetConfig<PaidgiftModel>().dataList[1].coins_quantity);
|
||||
|
||||
}
|
||||
}
|
||||
else if (type == PurchasingManager.pack_reward)
|
||||
{
|
||||
List<Paidgift> list = ConfigSystem.GetConfig<PaidgiftModel>().dataList;
|
||||
int gold_num = list[0].coins_quantity;
|
||||
int back_num = list[0].props_quantity[1];
|
||||
int out_num = list[0].props_quantity[0];
|
||||
int refresh_num = list[0].props_quantity[2];
|
||||
|
||||
GameHelper.AddItemNumber(0, out_num);
|
||||
GameHelper.AddItemNumber(1, back_num);
|
||||
GameHelper.AddItemNumber(2, refresh_num);
|
||||
SaveData.GetSaveobject().is_get_packreward = true;
|
||||
SaveData.saveDataFunc();
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.Sheep_item_refresh);
|
||||
purch_number = ConfigSystem.GetConfig<PaidgiftModel>().dataList[0].Paid_price.ToString();
|
||||
ui?.setBtnAds();
|
||||
|
||||
//如果关闭了购买界面,则需要进行刷新金币
|
||||
if(!UI.Instance.IsExistUI(UIConst.PackrewardUI))
|
||||
{
|
||||
// GameDispatcher.Instance.Dispatch(GameMsg.Gold_refresh);
|
||||
// PreferencesMgr.Instance.Currency101 += gold_num;
|
||||
ui.GetCoinAnim(gold_num);
|
||||
}
|
||||
}
|
||||
else if (type == PurchasingManager.battle_pass)
|
||||
{
|
||||
|
||||
SaveData.GetSaveobject().is_get_battlepass = true;
|
||||
int gold = 0;
|
||||
int out_ = 0;
|
||||
int back_ = 0;
|
||||
int refresh_ = 0;
|
||||
List<Passportrewards> Passportrewards_list = ConfigSystem.GetConfig<PassportrewardsModel>().dataList;
|
||||
for (int i = 0; i < Passportrewards_list.Count; i++)
|
||||
{
|
||||
if (GameHelper.GetBattleLv_Index() > i|| (GameHelper.GetGameExp() >= Passportrewards_list[Passportrewards_list.Count-1].Eliminating_quantity))
|
||||
{
|
||||
if (Passportrewards_list[i].Paid_rewards_type == 0) gold += Passportrewards_list[i].Paid_rewards_num;
|
||||
else if (Passportrewards_list[i].Paid_rewards_type == 1) out_ += Passportrewards_list[i].Paid_rewards_num;
|
||||
else if (Passportrewards_list[i].Paid_rewards_type == 2) back_ += Passportrewards_list[i].Paid_rewards_num;
|
||||
else if (Passportrewards_list[i].Paid_rewards_type == 3) refresh_ += Passportrewards_list[i].Paid_rewards_num;
|
||||
SaveData.GetSaveobject().battle_pass_paylist.Add(i + 1);
|
||||
}
|
||||
else break;
|
||||
}
|
||||
|
||||
// GameHelper.addGoldNumber(gold);
|
||||
GameHelper.AddItemNumber(0, out_);
|
||||
GameHelper.AddItemNumber(1, back_);
|
||||
GameHelper.AddItemNumber(2, refresh_);
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.Sheep_item_refresh);
|
||||
SaveData.saveDataFunc();
|
||||
purch_number = ConfigSystem.GetConfig<CommonModel>().Passportgift.ToString();
|
||||
|
||||
//如果关闭了购买界面,则需要进行刷新金币
|
||||
if(!UI.Instance.IsExistUI(UIConst.NewTaskUI))
|
||||
{
|
||||
// PreferencesMgr.Instance.Currency101 += gold;
|
||||
// GameDispatcher.Instance.Dispatch(GameMsg.Gold_refresh);
|
||||
ui.GetCoinAnim(gold);
|
||||
|
||||
}
|
||||
}
|
||||
else if (type == PurchasingManager.fail_pack)
|
||||
{
|
||||
List<Paidgift> list = ConfigSystem.GetConfig<PaidgiftModel>().dataList;
|
||||
purch_number = ConfigSystem.GetConfig<PaidgiftModel>().dataList[2].Paid_price.ToString();
|
||||
ui?.setBtnAds();
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.resurgence);
|
||||
|
||||
// PreferencesMgr.Instance.Currency101 += ConfigSystem.GetConfig<PaidgiftModel>().dataList[1].coins_quantity;
|
||||
// GameDispatcher.Instance.Dispatch(GameMsg.Gold_refresh);
|
||||
int back_num = list[2].props_quantity[1];
|
||||
int out_num = list[2].props_quantity[0];
|
||||
int refresh_num = list[2].props_quantity[2];
|
||||
Debug.Log("???????ttttttttt");
|
||||
//GameHelper.addGoldNumber(gold_num);
|
||||
int gold_num = list[2].coins_quantity;
|
||||
if (!UI.Instance.IsExistUI(UIConst.ResurgenceUI)) PreferencesMgr.Instance.Currency101 += gold_num;
|
||||
GameHelper.AddItemNumber(0, out_num);
|
||||
GameHelper.AddItemNumber(1, back_num);
|
||||
GameHelper.AddItemNumber(2, refresh_num);
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.Sheep_item_refresh);
|
||||
SaveData.saveDataFunc();
|
||||
|
||||
}
|
||||
else if (type == PurchasingManager.three_days_gift)
|
||||
{
|
||||
SaveData.GetSaveobject().is_get_ThreeDaysGift = true;
|
||||
SaveData.saveDataFunc();
|
||||
purch_number = ConfigSystem.GetConfig<MultigiftModel>().dataList[0].Paid_price2.ToString();
|
||||
}
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PayloadingUI_Close);
|
||||
|
||||
if (!GameHelper.IsAdModelOfPay() && !string.IsNullOrEmpty(purch_number) && decimal.TryParse(purch_number, out decimal revenue))
|
||||
{
|
||||
// Debug.Log("付费收益上报AF----------- " + revenue.ToString());
|
||||
adCallbackInfo.Clear();
|
||||
adCallbackInfo.Add("appsflyer_id", AppsFlyer.getAppsFlyerId());
|
||||
adCallbackInfo.Add("customer_user_id", GameHelper.GetLoginModel().uid.ToString());
|
||||
adCallbackInfo.Add("af_currency", "USD");
|
||||
adCallbackInfo.Add("af_revenue", revenue.ToString());
|
||||
AppsFlyer.sendEvent("af_purchase", adCallbackInfo);
|
||||
|
||||
GameHelper.sendRevenueToServer("af_purchase", "af_revenue", (int)(revenue * 10000));
|
||||
}
|
||||
|
||||
}
|
||||
public static Dictionary<string, string> adCallbackInfo = new Dictionary<string, string>();
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ad90dca2f6a8344fe8ce6cfd224043d1
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user