fix:1、添加项目

This commit is contained in:
2026-04-22 09:52:55 +08:00
commit 173cfb2dc9
5871 changed files with 600870 additions and 0 deletions
@@ -0,0 +1,42 @@
namespace FlowerPower
{
public class AddViewCtrl : BaseCtrl
{
public static AddViewCtrl Instance { get; private set; }
private AddViewModel model;
#region
protected override void OnInit()
{
Instance = this;
//model = ModuleManager.Instance..GetModel(ModelConst.AddViewModel) as AddViewModel;
}
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,43 @@
namespace FlowerPower
{
public class AddViewModel : 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,276 @@
using System;
using FGUI.P01_Common;
using FairyGUI;
using Spine.Unity;
using System.Collections.Generic;
using UnityEngine;
namespace FlowerPower
{
public class AddViewUI : BaseUI
{
private AddViewUICtrl ctrl;
private AddViewModel model;
private FGUI.P13_AddOne.com_addView ui;
public int ad_cool_down = 120;
public btn_watchAd btn_WatchAd;
private Action closeCallback;
public AddViewUI(AddViewUICtrl ctrl) : base(ctrl)
{
uiName = UIConst.AddViewUI;
this.ctrl = ctrl;
}
protected override void SetUIInfo(UIInfo uiInfo)
{
uiInfo.packageName = "P13_AddOne";
uiInfo.assetName = "com_addView";
uiInfo.layerType = UILayerType.Popup;
uiInfo.isNeedOpenAnim = false;
uiInfo.isNeedCloseAnim = false;
uiInfo.isNeedUIMask = true;
}
#region
protected override void OnInit()
{
//model = ModuleManager.Instance.GetModel(ModelConst.AddViewModel) as AddViewModel;
}
protected override void OnClose()
{
GameHelper.showGameUI = true;
HallManager.Instance.UpdateSecondEvent -= updateWatchCD;
if (GameHelper.IsAdModelOfPay())
{
AdRdManager.Instance.Destroy();
}
GameHelper.CallShowTurn();
}
protected override void OnBind()
{
ui = baseUI as FGUI.P13_AddOne.com_addView;
}
protected override void OnOpenBefore(object args)
{
NetworkKit.BuriedPoint(BuriedPointEvent.Apple_pay_event, BuriedPointEvent.buy_one_show, 1);
var sk = FXManager.Instance.SetFx<SkeletonAnimation>(ui.ani_node as GGraph, Fx_Type.fx_add, ref closeCallback);
sk.state.SetAnimation(0, "animation", true);
// ad_cool_down = ConfigSystem.GetConfig<CommonModel>().exchangeCD;
// btn_WatchAd = ui.btn_watch as btn_watchAd;
//0:付费模式 1:广告模式 2: 广告+付费模式
Debug.Log($"GetAddPayMode=======:{GameHelper.GetAddPayMode()}");
if (GameHelper.GetAddPayMode() == 1)
{
AdRdManager.Instance.SetWatchAd(PurchasingManager.buy_one, ui.btn_watch as btn_watchAd, SetTextString);
ui.pay_type.selectedIndex = 0;
AdRdManager.Instance.Start();
SetTextString();
}
else if (GameHelper.GetAddPayMode() == 0)
{
ui.pay_type.selectedIndex = 1;
decimal price = (decimal)GameHelper.GetCommonModel().addspace2;
ui.btn_max_pay.title = GameHelper.getPrice(price);
if (GameHelper.IsGiftSwitch() && ConfigSystem.GetConfig<CommonModel>().PiggyBankSwitch == 1) (ui.btn_max_pay.GetChild("img_saveingpot") as GImage).visible = true;
ui.btn_max_pay.SetClick(() =>
{
ApplePayClass maxPayData = new ApplePayClass
{
amount = (int)Math.Round(price * 100),
sku = PurchasingManager.buy_one,
currency = "USD"
};
MaxPayManager.Instance.Buy(maxPayData);
});
}
else if (GameHelper.GetAddPayMode() == 2)
{
var coinNum = GameHelper.GetCommonModel().AddSpaceCoin;
ui.pay_type.selectedIndex = 2;
ui.btn_gold_buy.text_num.text = GameHelper.Get101Str(coinNum);
ui.btn_gold_buy.visible = true;
ui.btn_gold_buy.SetClick(() =>
{
if (GameHelper.Get101() >= coinNum)
{
ui.btn_gold_buy.visible = false;
GameHelper.AddGold(-coinNum);
BuyAfterEvent();
}
else
{
GameHelper.ShowTips("Your Coin is insufficient!");
}
});
if (GameHelper.IsGiftSwitch() && ConfigSystem.GetConfig<CommonModel>().PiggyBankSwitch == 1) ui.btn_watch_ad.img_saveingpot.visible = true;
ui.btn_watch_ad.SetClick(() =>
{
GameHelper.ShowVideoAd("add_one", isSuccess =>
{
if (isSuccess)
{
var timeCd = ConfigSystem.GetConfig<CommonModel>().PropCD;
var ad_times = Convert.ToInt32(GameHelper.GetNowTime());
SaveData.GetSaveobject().add_one_watch_ad_cd = timeCd + ad_times;
BuyAfterEvent();
}
});
});
}
if (GameHelper.IsGiftSwitch())
{
ui.broad.visible = true;
}
else
{
ui.broad.visible = false;
}
InitView();
}
private void BuyAfterEvent()
{
SaveData.GetSaveobject().have_slot = true;
SaveData.saveDataFunc();
GameDispatcher.Instance.Dispatch(GameMsg.Slot_refresh);
CtrlCloseUI();
}
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 pay_success(object str)
{
string type = (string)str;
if (type == PurchasingManager.buy_one)
{
CtrlCloseUI();
}
}
//初始化页面逻辑
private void InitView()
{
ui.btn_close.SetClick(() =>
{
CtrlCloseUI();
GameDispatcher.Instance.Dispatch(GameMsg.resurgence_close);
});
HallManager.Instance.UpdateSecondEvent += updateWatchCD;
updateWatchCD();
InitBroadCast();
// checkBtnState();
}
void updateWatchCD()
{
broadtime++;
BroadCast();
var lastTimes = SaveData.GetSaveobject().add_one_watch_ad_cd;
if (GameHelper.GetNowTime() < lastTimes)
{
ui.btn_watch_ad.can_buy.selectedIndex = 1;
ui.btn_watch_ad.btn_text.text = CommonHelper.TimeFormat(lastTimes - Convert.ToInt32(GameHelper.GetNowTime()), CountDownType.Hour);
}
else
{
ui.btn_watch_ad.can_buy.selectedIndex = 0;
}
}
public void SetTextString()
{
var need = AdRdManager.Instance.GetCeilingNeedAds(PurchasingManager.buy_one);
var myAd = AdRdManager.Instance.GetLookRewardADNum();
ui.tips.SetVar("num", need.ToString()).FlushVars();
ui.ads.SetVar("num", myAd.ToString()).FlushVars();
}
private int broadtime = 1;
private List<string> config_name_list = ConfigSystem.GetConfig<LevelAttemptsModel>().config_name_list;
private List<string> config_money_list = ConfigSystem.GetConfig<LevelAttemptsModel>().config_money_list;
private List<string[]> broad_list = new List<string[]>();
private void BroadCast()
{
if (broadtime % 3 == 0)
{
(ui.broad as com_broadcast_new).t1.Play(() =>
{
broad_list.RemoveAt(0);
int name_index = UnityEngine.Random.Range(0, config_name_list.Count);
int money_index = UnityEngine.Random.Range(0, config_money_list.Count);
broad_list.Add(new string[2] { config_name_list[name_index], config_money_list[money_index] });
for (int i = 0; i < 4; i++)
{
text_list[i].text = "Congratulations,User [color=#ad4800][size=36]" + broad_list[i][0] + "[/size][/color] !After purchasing the +1 Block Pack,play [color=#ad4800]" + broad_list[i][1] + "[/color] matcher to clear the level!";
}
});
}
}
private List<GTextField> text_list = new List<GTextField>();
private void InitBroadCast()
{
text_list.Add((ui.broad as com_broadcast_new).text_0);
text_list.Add((ui.broad as com_broadcast_new).text_1);
text_list.Add((ui.broad as com_broadcast_new).text_2);
text_list.Add((ui.broad as com_broadcast_new).text_3);
for (int i = 0; i < 4; i++)
{
int name_index = UnityEngine.Random.Range(0, config_name_list.Count);
int money_index = UnityEngine.Random.Range(0, config_money_list.Count);
broad_list.Add(new string[2] { config_name_list[name_index], config_money_list[money_index] });
text_list[i].text = "Congratulations,User [color=#ad4800][size=36]" + broad_list[i][0] + "[/size][/color] !After purchasing the +1 Block Pack,play [color=#ad4800]" + broad_list[i][1] + "[/color] matcher to clear the level!";
}
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 40b42d370a2c34db89da3decb4b3ba0d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,71 @@
namespace FlowerPower
{
public class AddViewUICtrl : BaseUICtrl
{
private AddViewUI ui;
private AddViewModel model;
private uint openUIMsg = UICtrlMsg.BuyslotUI_Open;
private uint closeUIMsg = UICtrlMsg.BuyslotUI_Close;
#region
protected override void OnInit()
{
//model = ModuleManager.Instance.GetModel(ModelConst.AddViewModel) as AddViewModel;
}
protected override void OnDispose()
{
}
public override void OpenUI(object args = null)
{
if (ui == null)
{
ui = new AddViewUI(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: