提交项目

This commit is contained in:
2026-05-28 15:23:36 +08:00
commit 3cfc77d12b
5726 changed files with 554351 additions and 0 deletions
@@ -0,0 +1,45 @@
using System.Collections;
using System.Collections.Generic;
namespace ZooMatch
{
public class BuygoldCtrl : BaseCtrl
{
public static BuygoldCtrl Instance { get; private set; }
private BuygoldModel model;
#region
protected override void OnInit()
{
Instance = this;
//model = ModuleManager.Instance..GetModel(ModelConst.BuygoldModel) as BuygoldModel;
}
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: 2342594a3679d4cc3871150e477d7ffb
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,30 @@
using System.Collections;
using System.Collections.Generic;
namespace ZooMatch
{
public class BuygoldModel : BaseModel
{
#region
protected override void OnInit()
{
}
protected override void OnDispose()
{
}
#endregion
#region
protected override void AddListener()
{
}
protected override void RemoveListener()
{
}
#endregion
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 14fccb4c1b1fb4e7188a1c7a070629dc
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,321 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using FutureCore;
using FairyGUI;
using FGUI.ZM_store_17;
using System;
using DG.Tweening;
using Newtonsoft.Json;
using FGUI.ZM_Common_01;
using IgnoreOPS;
namespace ZooMatch
{
public class BuygoldUI : BaseUI
{
private BuygoldUICtrl ctrl;
private BuygoldModel model;
private FGUI.ZM_store_17.com_buygold ui;
public BuygoldUI(BuygoldUICtrl ctrl) : base(ctrl)
{
uiName = UIConst.BuygoldUI;
this.ctrl = ctrl;
}
protected override void SetUIInfo(UIInfo uiInfo)
{
uiInfo.packageName = "ZM_store_17";
uiInfo.assetName = "com_buygold";
uiInfo.layerType = UILayerType.Popup;
uiInfo.isNeedOpenAnim = false;
uiInfo.isNeedCloseAnim = false;
uiInfo.isNeedUIMask = true;
}
#region
protected override void OnInit()
{
//model = ModuleManager.Instance.GetModel(ModelConst.BuygoldModel) as BuygoldModel;
}
protected override void OnClose()
{
GameHelper.showGameUI = true;
HallManager.Instance.UpdateSecondEvent -= initList;
HallManager.Instance.UpdateSecondEvent -= upWatchAdsBtn;
WebviewManager.Instance.SetDarkThough(true);
}
protected override void OnBind()
{
ui = baseUI as FGUI.ZM_store_17.com_buygold;
}
protected override void OnOpenBefore(object args)
{
if (Screen.safeArea.y != 0)
{//刘海屏
ui.top_gold.y += Screen.safeArea.y-15;
}
NetworkKit.BuriedPoint(BuriedPointEvent.Apple_pay_event, BuriedPointEvent.gold_show, 1);
WebviewManager.Instance.SetDarkThough(false);
ui.top_gold.GetChild("text_gold").text = GameHelper.Get101Str(GameHelper.GetGoldNumber());
ui.pay_type.selectedIndex = !GameHelper.IsAdModelOfPay() ? 1 : 0;
InitView();
HallManager.Instance.UpdateSecondEvent += initList;
HallManager.Instance.UpdateSecondEvent += upWatchAdsBtn;
}
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);
}
protected override void RemoveListener()
{
GameDispatcher.Instance.RemoveListener(GameMsg.apple_pay_success, pay_success);
}
#endregion
void GetAward(decimal gold, int index)
{
var item = ui.gold_list.GetChildAt(index);
var start = GameHelper.GetUICenterPosition(item);
var end = GameHelper.GetUICenterPosition(ui.top_gold.GetChild("text_gold"));
var rewardData = new RewardData();
var rewardSingleData = new RewardSingleData(101, gold, RewardOrigin.AdTask)
{
startPosition = start,
endPosition = new Vector2(end.x - 150, end.y - 136)
};
rewardData.AddReward(rewardSingleData);
rewardData.displayType = RewardDisplayType.RewardFly | RewardDisplayType.ValueChange;
rewardData.AddCompleted((isScu) =>
{
DOVirtual.DelayedCall(0.5f, () =>
{
var startNum = PreferencesMgr.Instance.Currency101 - gold;
DOVirtual.Float((float)startNum, (float)GameHelper.GetGoldNumber(), 1f,
value => { ui.top_gold.GetChild("text_gold").text = GameHelper.Get101Str((decimal)value);});
});
});
GameDispatcher.Instance.Dispatch(GameMsg.GetReward, rewardData);
}
void pay_success(object str)
{
string type = (string)str;
string purch_number = "";
if (type.StartsWith("buy_gold"))
{
int startIndex = "buy_gold".Length;
string suffix = type[startIndex..]; // 截取 "gold" 后的所有字符
int suffix_num = int.Parse(suffix);
SaveData.GetSaveobject()._goldtime[suffix_num] = (int)GameHelper.GetNowTime();
SaveData.saveDataFunc();
GetAward(list[suffix_num].Actual_coins, suffix_num);
purch_number = list[suffix_num].Payment_amount.ToString();
}
// if (purch_number != "")
// {
// GameHelper.SendRevenueToAF(purch_number);
// }
SetTextString();
}
//初始化页面逻辑
private void InitView()
{
ui.top_gold.touchable = false;
ui.btn_close.SetClick(() => { UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.BuygoldUI_Close); });
initList();
upWatchAdsBtn();
ui.btn_watch.SetClick(() =>
{
NetworkKit.BuriedPoint(BuriedPointEvent.Apple_pay_event, BuriedPointEvent.gold_click_ad,1);
GameHelper.ShowVideoAd("BuyGold", (issuccess) =>
{
if (issuccess)
{
var ad_times = Convert.ToInt32(GameHelper.GetNowTime());
SaveData.GetSaveobject()._watch_ad_cd = ad_times + GameHelper.GetCommonModel().exchangeCD;
initList();
}
});
});
}
private List<Paidcoins> list = ConfigSystem.GetConfig<PaidcoinsModel>().dataList;
void initList()
{
ui.gold_list.itemRenderer = setRemaintime;
ui.gold_list.numItems = list.Count;
SetTextString();
}
public void upWatchAdsBtn()
{
var lastTimes = SaveData.GetSaveobject()._watch_ad_cd;
ui.btn_watch.img_saveingpot.visible = false;
if (GameHelper.GetNowTime() < lastTimes )
{
ui.btn_watch.enabled = false;
ui.btn_watch.can_buy.selectedIndex = 1;
ui.btn_watch.btn_text.text = CommonHelper.TimeFormat(lastTimes - Convert.ToInt32(GameHelper.GetNowTime()),CountDownType.Hour);
} else {
ui.btn_watch.enabled = true;
ui.btn_watch.can_buy.selectedIndex = 0;
if (GameHelper.IsGiftSwitch() && ConfigSystem.GetConfig<CommonModel>().PiggyBankSwitch == 1) ui.btn_watch.img_saveingpot.visible = true;
}
}
public void SetTextString()
{
var myAds = AdRedeemManager.Instance.GetLookRewardADNum();
ui.text_my_ads.SetVar("ads", myAds.ToString()).FlushVars();
}
void setRemaintime(int index, GObject obj)
{
buygold_item item = (buygold_item)obj;
int time = 0;
time = SaveData.GetSaveobject()._goldtime[index];
item.coin_text.text = GameHelper.Get101Str(list[index].Actual_coins);
item.index.selectedIndex = index > 4 ? 4 : index;
item.off_text.text = list[index].Discount_rate + "%";
item.discount.visible = !GameHelper.IsAdModelOfPay() && list[index].Discount_rate > 0;
item.btn_buy.img_saveingpot.visible=false;
if (list[index].Discount_rate != 0) item.off_text.text = list[index].Discount_rate + "%";
if (time + list[index].receive_CD < GameHelper.GetNowTime())
{
if (index == 0)
{
item.btn_buy.btn_text.text = "Free";
item.discount.visible = false;
}
else
{
if (!GameHelper.IsAdModelOfPay()){
decimal price = (decimal)list[index].Payment_amount2;
item.btn_buy.btn_text.text = GameHelper.Get102Str(price);
item.text_ads.visible = false;
} else {
double gold_price1 = list[index].Payment_amount;
int needAds = (int)Math.Ceiling(gold_price1);
item.text_ads.SetVar("num", needAds.ToString()).FlushVars();
item.btn_buy.btn_text.text = needAds + " AD";
}
if (GameHelper.IsGiftSwitch() && ConfigSystem.GetConfig<CommonModel>().PiggyBankSwitch == 1) item.btn_buy.img_saveingpot.visible=true;
}
item.btn_buy.can_buy.selectedIndex = 0;
item.btn_buy.SetClick(() =>
{
if (index == 0)
{
SaveData.GetSaveobject()._goldtime[0] = (int)GameHelper.GetNowTime();
SaveData.saveDataFunc();
GetAward(list[index].Actual_coins, 0);
InitView();
}
else
{
redeem_Gold(index);
}
});
}
else
{
item.btn_buy.can_buy.selectedIndex = 1;
if(!GameHelper.IsAdModelOfPay())
{
} else {
double gold_price1 = list[index].Payment_amount;
int needAds = (int)Math.Ceiling(gold_price1);
item.btn_buy.btn_text.text = needAds + " AD";
}
item.btn_buy.btn_text.text = CommonHelper.TimeFormat(time + list[index].receive_CD - Convert.ToInt32(GameHelper.GetNowTime()), CountDownType.Hour);
item.btn_buy.SetClick(() =>
{
});
}
}
private void redeem_Gold(int index)
{
string _type = "buy_gold" + index.ToString();
if (GameHelper.IsAdModelOfPay())
{
AdRedeemData test = new AdRedeemData()
{
ad_count = AdRedeemManager.Instance.GetCeilingNeedAds(_type),
type = _type,
};
AdRedeemManager.Instance.Redeem(test);
}
else
{
decimal price = (decimal)list[index].Payment_amount2;
MaxPayClass maxPayData = new MaxPayClass()
{
amount = (int)Math.Round(price * 100),
sku = _type,
currency = "USD"
};
MaxPayManager.Instance.Buy(maxPayData);
}
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 7de4ee29003a34adbb4ff4e0c97ed52c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,75 @@
using System.Collections;
using System.Collections.Generic;
namespace ZooMatch
{
public class BuygoldUICtrl : BaseUICtrl
{
private BuygoldUI ui;
private BuygoldModel model;
private uint openUIMsg = UICtrlMsg.BuygoldUI_Open;
private uint closeUIMsg = UICtrlMsg.BuygoldUI_Close;
#region
protected override void OnInit()
{
//model = ModuleManager.Instance.GetModel(ModelConst.BuygoldModel) as BuygoldModel;
}
protected override void OnDispose()
{
}
public override void OpenUI(object args = null)
{
if (ui == null)
{
ui = new BuygoldUI(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: bfad94d0fa70d40bd8308f8fb11b9520
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: