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
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 9717499f5de1c4919858e43697142105
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,45 @@
using System.Collections;
using System.Collections.Generic;
namespace FlowerPower
{
public class AdcomingCtrl : BaseCtrl
{
public static AdcomingCtrl Instance { get; private set; }
private AdcomingModel model;
#region
protected override void OnInit()
{
Instance = this;
//model = ModuleManager.Instance..GetModel(ModelConst.AdcomingModel) as AdcomingModel;
}
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: c8bd042de9ef64e59b65fefb9788f71d
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 FlowerPower
{
public class AdcomingModel : 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: 29789969ee11944f8be5196fc0b81532
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,114 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using FutureCore;
using FairyGUI;
using DG.Tweening;
namespace FlowerPower
{
public class AdcomingUI : BaseUI
{
private AdcomingUICtrl ctrl;
private AdcomingModel model;
private FGUI.P17_PackAward.com_adcoming ui;
public AdcomingUI(AdcomingUICtrl ctrl) : base(ctrl)
{
uiName = UIConst.AdcomingUI;
this.ctrl = ctrl;
}
protected override void SetUIInfo(UIInfo uiInfo)
{
uiInfo.packageName = "P17_PackAward";
uiInfo.assetName = "com_adcoming";
uiInfo.layerType = UILayerType.Popup;
uiInfo.isNeedOpenAnim = false;
uiInfo.isNeedCloseAnim = false;
uiInfo.isNeedUIMask = true;
}
#region
protected override void OnInit()
{
//model = ModuleManager.Instance.GetModel(ModelConst.AdcomingModel) as AdcomingModel;
}
protected override void OnClose()
{
}
protected override void OnBind()
{
ui = baseUI as FGUI.P17_PackAward.com_adcoming;
}
protected override void OnOpenBefore(object args)
{
InitView();
}
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.pack_close, playAni);
}
protected override void RemoveListener()
{
GameDispatcher.Instance.RemoveListener(GameMsg.pack_close, playAni);
}
#endregion
private int time = 5;
//初始化页面逻辑
private void InitView()
{
ui.time_text.text = time.ToString();
tweer = DOVirtual.Float(time, 0, time, value =>
{
ui.time_text.text = ((int)value).ToString();
float progress = Mathf.InverseLerp(time, 0, value);
ui.img_progress.fillAmount = progress;
}).SetEase(Ease.Linear);
tweer.onComplete += () =>
{
CtrlCloseUI();
GameHelper.ShowInterstitial("interstitial_gameend");
};
tweer2 = DOVirtual.Float(time, 0, time, value => { ui.img_progress.text = ((int)value).ToString(); });
ui.btn_removead.SetClick(() =>
{
PackRewardData param = new PackRewardData();
param.isAutoPop = false;
param.isNeedScroll = true;
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PackrewardUI_Open, param);
tweer.Pause();
});
}
private Tween tweer;
private Tween tweer2;
void playAni(object a)
{
tweer.Play();
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: dfe9a378b6c07410b91e71ce80c75a05
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,74 @@
using System.Collections;
using System.Collections.Generic;
namespace FlowerPower
{
public class AdcomingUICtrl : BaseUICtrl
{
private AdcomingUI ui;
private AdcomingModel model;
private uint openUIMsg = UICtrlMsg.AdcomingUI_Open;
private uint closeUIMsg = UICtrlMsg.AdcomingUI_Close;
#region
protected override void OnInit()
{
//model = ModuleManager.Instance.GetModel(ModelConst.AdcomingModel) as AdcomingModel;
}
protected override void OnDispose()
{
}
public override void OpenUI(object args = null)
{
if (ui == null)
{
ui = new AdcomingUI(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: dbf393f35eff5477da2f9c69a02c3822
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 3ec7125d0333e284db6729a02dd964b0
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -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:
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 3910c987440d8ea46846b1855bfcb7bc
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,25 @@
namespace FlowerPower
{
public class AddViewoffCtrl : BaseCtrl
{
public static AddViewoffCtrl Instance { get; private set; }
private AddViewoffModel model;
#region
protected override void OnInit()
{
Instance = this;
//model = ModuleManager.Instance..GetModel(ModelConst.AddViewoffModel) as AddViewoffModel;
}
protected override void OnDispose()
{
Instance = null;
}
#endregion
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 6254fab7306ab4f54b9ddc37e9f9c554
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,20 @@
namespace FlowerPower
{
public class AddViewoffModel : BaseModel
{
#region
protected override void OnInit()
{
}
protected override void OnDispose()
{
}
#endregion
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 8927197c6cb1f412d83d93ded8cf1589
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,234 @@
using FairyGUI;
using FGUI.P01_Common;
using Spine.Unity;
using System;
using System.Collections.Generic;
namespace FlowerPower
{
public class AddViewoffUI : BaseUI
{
private AddViewoffUICtrl ctrl;
private AddViewoffModel model;
private FGUI.P13_AddOne.com_addView_off ui;
private Action closeCallback;
public AddViewoffUI(AddViewoffUICtrl ctrl) : base(ctrl)
{
uiName = UIConst.AddViewoffUI;
this.ctrl = ctrl;
}
protected override void SetUIInfo(UIInfo uiInfo)
{
uiInfo.packageName = "P13_AddOne";
uiInfo.assetName = "com_addView_off";
uiInfo.layerType = UILayerType.Popup;
uiInfo.isNeedOpenAnim = false;
uiInfo.isNeedCloseAnim = false;
uiInfo.isNeedUIMask = true;
}
#region
protected override void OnInit()
{
//model = ModuleManager.Instance.GetModel(ModelConst.AddViewoffModel) as AddViewoffModel;
}
protected override void OnClose()
{
GameHelper.showGameUI = true;
HallManager.Instance.UpdateSecondEvent -= updateWatchCD;
if (GameHelper.IsAdModelOfPay())
{
AdRdManager.Instance.Destroy();
}
closeCallback?.Invoke();
GameHelper.CallShowTurn();
}
protected override void OnBind()
{
ui = baseUI as FGUI.P13_AddOne.com_addView_off;
}
protected override void OnOpenBefore(object args)
{
// if (ui.btn_watch is btn_watchAd watchAdBtn)
// {
// CommonTools.GetInstance.InitAdBtnAnim(watchAdBtn.icon_Parent);
// }
var sk = FXManager.Instance.SetFx<SkeletonAnimation>(ui.ani_node as GGraph, Fx_Type.fx_add, ref closeCallback);
sk.state.SetAnimation(0, "animation", true);
NetworkKit.BuriedPoint(BuriedPointEvent.Apple_pay_event, BuriedPointEvent.BuyOneOffShow, 1);
if (GameHelper.IsGiftSwitch() && ConfigSystem.GetConfig<CommonModel>().PiggyBankSwitch == 1)
{
(ui.btn_max_pay.GetChild("img_saveingpot") as GImage).visible = true;
}
// ad_cool_down = ConfigSystem.GetConfig<CommonModel>().exchangeCD;
// btn_WatchAd = ui.btn_watch as btn_watchAd;
if (GameHelper.IsAdModelOfPay())
{
AdRdManager.Instance.SetWatchAd(PurchasingManager.buy_one_off, ui.btn_watch as btn_watchAd, SetTextString);
ui.pay_type.selectedIndex = 0;
ui.text_old_price.text = GameHelper.GetCommonModel().addspace + "ADs";
btn_watchAd btn = ui.btn_watch as btn_watchAd;
AdRdManager.Instance.Start();
SetTextString();
}
else
{
ui.pay_type.selectedIndex = 1;
ui.text_old_price.text = "$ " + GameHelper.GetCommonModel().addspace2;
decimal price = (decimal)GameHelper.GetCommonModel().AddDiscount2;
ui.btn_max_pay.title = GameHelper.getPrice(price);
ui.btn_max_pay.SetClick(() =>
{
ApplePayClass maxPayData = new ApplePayClass
{
amount = (int)Math.Round(price * 100),
sku = PurchasingManager.buy_one_off,
currency = "USD"
};
MaxPayManager.Instance.Buy(maxPayData);
});
}
if (GameHelper.IsGiftSwitch())
{
ui.broad.visible = true;
}
else
{
ui.broad.visible = false;
}
InitView();
InitBroadCast();
}
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_off)
{
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.AddViewoffUI_Close);
SaveData.GetSaveobject().have_slot = true;
SaveData.saveDataFunc();
GameDispatcher.Instance.Dispatch(GameMsg.Slot_refresh);
GameDispatcher.Instance.Dispatch(GameMsg.resurgence_close);
CtrlCloseUI();
}
}
//初始化页面逻辑
private void InitView()
{
// var tAnimation = FXManager.Instance.SetFx<SkeletonAnimation>(ui.tip_parent, Fx_Type.Fx_AddBoxTip, ref _closeCallback);
// tAnimation.state.AddAnimation(0, "animation", true, 0);
ui.btn_close.SetClick(() =>
{
GameDispatcher.Instance.Dispatch(GameMsg.resurgence_close);
CtrlCloseUI();
});
HallManager.Instance.UpdateSecondEvent += updateWatchCD;
// updateWatchCD();
// checkBtnState();
}
void updateWatchCD()
{
ui.text_time.text = CommonHelper.TimeFormat((int)SaveData.GetSaveobject().addview_off_time - Convert.ToInt32(GameHelper.GetNowTime()), CountDownType.Hour);
broadtime++;
BroadCast();
}
public void SetTextString()
{
var need = AdRdManager.Instance.GetCeilingNeedAds(PurchasingManager.buy_one_off);
var myAd = AdRdManager.Instance.GetLookRewardADNum();
ui.tips.SetVar("num", need.ToString()).FlushVars();
ui.ads.SetVar("num", myAd + "/").FlushVars();
ui.ads.SetVar("num1", need.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: 95a4ab1450a704a8a86208f20b15f859
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,73 @@
namespace FlowerPower
{
public class AddViewoffUICtrl : BaseUICtrl
{
private AddViewoffUI ui;
private AddViewoffModel model;
private uint openUIMsg = UICtrlMsg.AddViewoffUI_Open;
private uint closeUIMsg = UICtrlMsg.AddViewoffUI_Close;
#region
protected override void OnInit()
{
//model = ModuleManager.Instance.GetModel(ModelConst.AddViewoffModel) as AddViewoffModel;
}
protected override void OnDispose()
{
}
public override void OpenUI(object args = null)
{
if (ui == null)
{
ui = new AddViewoffUI(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: 0482db053a1ce45d989a2e4a715dff81
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c818683ad0008c741a3155715904df35
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,25 @@
namespace FlowerPower
{
public class AddviewnewCtrl : BaseCtrl
{
public static AddviewnewCtrl Instance { get; private set; }
private AddviewnewModel model;
#region
protected override void OnInit()
{
Instance = this;
//model = ModuleManager.Instance..GetModel(ModelConst.AddviewnewModel) as AddviewnewModel;
}
protected override void OnDispose()
{
Instance = null;
}
#endregion
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 4cc0dc1a5313d412a83b8e39a7efb8fc
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,20 @@
namespace FlowerPower
{
public class AddviewnewModel : BaseModel
{
#region
protected override void OnInit()
{
}
protected override void OnDispose()
{
}
#endregion
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 046c52d08595a4040a001d8004b8875c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,247 @@
using UnityEngine;
using FairyGUI;
using SGModule.Net;
using IgnoreOPS;
using System;
using Spine.Unity;
using FGUI.P01_Common;
namespace FlowerPower
{
public class AddviewnewUI : BaseUI
{
private AddviewnewUICtrl ctrl;
private AddviewnewModel model;
private FGUI.P13_AddOne.com_addView_new ui;
private bool is_off = false;
public AddviewnewUI(AddviewnewUICtrl ctrl) : base(ctrl)
{
uiName = UIConst.AddviewnewUI;
this.ctrl = ctrl;
}
protected override void SetUIInfo(UIInfo uiInfo)
{
uiInfo.packageName = "P13_AddOne";
uiInfo.assetName = "com_addView_new";
uiInfo.layerType = UILayerType.Popup;
uiInfo.isNeedOpenAnim = false;
uiInfo.isNeedCloseAnim = false;
uiInfo.isNeedUIMask = true;
}
#region
protected override void OnInit()
{
//model = ModuleManager.Instance.GetModel(ModelConst.AddviewnewModel) as AddviewnewModel;
}
private Action closeCallback;
protected override void OnClose()
{
GameHelper.showGameUI = true;
HallManager.Instance.UpdateSecondEvent -= updateWatchCD;
closeCallback?.Invoke();
AdRdManager.Instance.Destroy();
}
protected override void OnBind()
{
ui = baseUI as FGUI.P13_AddOne.com_addView_new;
}
protected override void OnOpenBefore(object args)
{
// if (ui.btn_watch is btn_watchAd watchAdBtn)
// {
// CommonTools.GetInstance.InitAdBtnAnim(watchAdBtn.icon_Parent);
// }
if (SaveData.GetSaveobject().addview_off_time > GameHelper.GetNowTime()) is_off = true;
ui.text_out.text = "x" + GameHelper.GetItemNumber(0);
ui.text_back.text = "x" + GameHelper.GetItemNumber(1);
ui.text_refresh.text = "x" + GameHelper.GetItemNumber(2);
ui.text_level.text = "Level " + GameHelper.GetLevel();
NetworkKit.BuriedPoint(BuriedPointEvent.Apple_pay_event, BuriedPointEvent.BuyOneNewShow, 1);
ui.btn_play.SetClick(() =>
{
GameDispatcher.Instance.Dispatch(GameMsg.OpenGame);
CtrlCloseUI();
});
if (GameHelper.IsGiftSwitch() && ConfigSystem.GetConfig<CommonModel>().PiggyBankSwitch == 1)
{
(ui.btn_max_pay.GetChild("img_saveingpot") as GImage).visible = true;
}
// ui.btn_watch.GetChild("img_saveingpot").x += 20;
// ui.btn_watch.GetChild("img_saveingpot").y -= 33;
// ad_cool_down = ConfigSystem.GetConfig<CommonModel>().exchangeCD;
// btn_WatchAd = ui.btn_watch as btn_watchAd;
if (GameHelper.IsAdModelOfPay())
{
if (is_off)
{
AdRdManager.Instance.SetWatchAd(PurchasingManager.buy_one_off, ui.btn_watch as btn_watchAd, () =>
{
NetworkKit.BuriedPoint(BuriedPointEvent.Apple_pay_event, BuriedPointEvent.BuyOneNewClick, 1);
SetTextString();
});
ui.pay_type.selectedIndex = 0;
AdRdManager.Instance.Start();
}
else
{
AdRdManager.Instance.SetWatchAd(PurchasingManager.buy_one, ui.btn_watch as btn_watchAd, () =>
{
NetworkKit.BuriedPoint(BuriedPointEvent.Apple_pay_event, BuriedPointEvent.BuyOneNewClick, 1);
SetTextString();
});
ui.pay_type.selectedIndex = 0;
AdRdManager.Instance.Start();
}
SetTextString();
}
else
{
ui.pay_type.selectedIndex = 1;
if (is_off)
{
decimal price = (decimal)GameHelper.GetCommonModel().AddDiscount2;
ui.btn_max_pay.title = GameHelper.getPrice(price);
ui.btn_max_pay.SetClick(() =>
{
NetworkKit.BuriedPoint(BuriedPointEvent.Apple_pay_event, BuriedPointEvent.BuyOneNewClick, 1);
ApplePayClass maxPayData = new ApplePayClass
{
amount = (int)Math.Round(price * 100),
sku = PurchasingManager.buy_one_off,
currency = "USD"
};
MaxPayManager.Instance.Buy(maxPayData);
});
}
else
{
decimal price = (decimal)GameHelper.GetCommonModel().addspace2;
ui.btn_max_pay.title = GameHelper.getPrice(price);
ui.btn_max_pay.SetClick(() =>
{
NetworkKit.BuriedPoint(BuriedPointEvent.Apple_pay_event, BuriedPointEvent.BuyOneNewClick, 1);
ApplePayClass maxPayData = new ApplePayClass()
{
amount = (int)Math.Round(price * 100),
sku = PurchasingManager.buy_one,
currency = "USD"
};
MaxPayManager.Instance.Buy(maxPayData);
});
}
}
InitView();
}
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);
GameDispatcher.Instance.AddListener(GameMsg.Sheep_item_refresh, SetItemNumber);
}
protected override void RemoveListener()
{
GameDispatcher.Instance.RemoveListener(GameMsg.apple_pay_success, pay_success);
GameDispatcher.Instance.RemoveListener(GameMsg.Sheep_item_refresh, SetItemNumber);
}
#endregion
void SetItemNumber(object a)
{
ui.text_out.text = "x" + GameHelper.GetItemNumber(0);
ui.text_back.text = "x" + GameHelper.GetItemNumber(1);
ui.text_refresh.text = "x" + GameHelper.GetItemNumber(2);
}
void pay_success(object str)
{
string type = (string)str;
if (type == PurchasingManager.buy_one || type == PurchasingManager.buy_one_off)
{
NetworkKit.BuriedPoint(BuriedPointEvent.Apple_pay_event, BuriedPointEvent.BuyOneNewSuccess, 1);
SaveData.GetSaveobject().have_slot = true;
SaveData.saveDataFunc();
GameDispatcher.Instance.Dispatch(GameMsg.Slot_refresh);
ui.pay_type.selectedIndex = 2;
// SkeletonAnimation addeffect = FXManager.Instance.SetFx<SkeletonAnimation>(ui.ani_parent1, Fx_Type.fx_addeffect, ref closeCallback);
// addeffect.state.SetAnimation(0, "animation", true);
// SkeletonAnimation addeffect1 = FXManager.Instance.SetFx<SkeletonAnimation>(ui.ani_parent2, Fx_Type.fx_addarrow, ref closeCallback);
// addeffect1.state.SetAnimation(0, "animation", true);
// CtrlCloseUI();
}
}
//初始化页面逻辑
private void InitView()
{
var tAnimation = FXManager.Instance.SetFx<SkeletonAnimation>(ui.ani_powerup, Fx_Type.fx_powerup, ref closeCallback);
tAnimation.state.SetAnimation(0, "animation", true);
ui.btn_close.SetClick(() =>
{
GameDispatcher.Instance.Dispatch(GameMsg.OpenGame);
CtrlCloseUI();
});
HallManager.Instance.UpdateSecondEvent += updateWatchCD;
ui.btn_addback.SetClick(() =>
{
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.SheepwindowUI_Open, 1);
});
ui.btn_addout.SetClick(() =>
{
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.SheepwindowUI_Open, 0);
});
ui.btn_addrefresh.SetClick(() =>
{
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.SheepwindowUI_Open, 2);
});
// updateWatchCD();
// checkBtnState();
}
void updateWatchCD()
{
}
public void SetTextString()
{
int need = 0;
if (is_off) need = AdRdManager.Instance.GetCeilingNeedAds(PurchasingManager.buy_one_off);
else need = AdRdManager.Instance.GetCeilingNeedAds(PurchasingManager.buy_one);
var myAd = AdRdManager.Instance.GetLookRewardADNum();
// ui.tips.SetVar("num", need.ToString()).FlushVars();
ui.ads.SetVar("num", myAd + "/").FlushVars();
ui.ads.SetVar("num1", need.ToString()).FlushVars();
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 3b62f3687397048a0a4365a156cc3eac
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,73 @@
namespace FlowerPower
{
public class AddviewnewUICtrl : BaseUICtrl
{
private AddviewnewUI ui;
private AddviewnewModel model;
private uint openUIMsg = UICtrlMsg.AddviewnewUI_Open;
private uint closeUIMsg = UICtrlMsg.AddviewnewUI_Close;
#region
protected override void OnInit()
{
//model = ModuleManager.Instance.GetModel(ModelConst.AddviewnewModel) as AddviewnewModel;
}
protected override void OnDispose()
{
}
public override void OpenUI(object args = null)
{
if (ui == null)
{
ui = new AddviewnewUI(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: a375bc5ca46a34c92bc7dfa4c493c980
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 1b5a9ea3a6ed94acea0ffb49d590cccb
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,23 @@
using System.Collections;
using System.Collections.Generic;
namespace FlowerPower
{
public class BroadcastCtrl : BaseCtrl
{
public static BroadcastCtrl Instance { get; private set; }
private BroadcastModel model;
protected override void OnInit()
{
Instance = this;
}
protected override void OnDispose()
{
Instance = null;
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 575f1d3d71a8445bc8d960a3f33d8bc1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,13 @@
namespace FlowerPower
{
public class BroadcastModel : BaseModel
{
protected override void OnInit()
{
}
protected override void OnDispose()
{
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 2362fee130b6f4067b943f44ba629113
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,218 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using FutureCore;
using FairyGUI;
using System;
using DG.Tweening;
using Spine.Unity;
using FlowerPower;
using FGUI.P01_Common;
namespace FlowerPower
{
public class BroadcastUI : BaseUI
{
private BroadcastUICtrl ctrl;
private BroadcastModel model;
private FGUI.P01_Common.com_broadcast1 ui;
public BroadcastUI(BroadcastUICtrl ctrl) : base(ctrl)
{
uiName = UIConst.BroadcastUI;
this.ctrl = ctrl;
}
protected override void SetUIInfo(UIInfo uiInfo)
{
uiInfo.packageName = "P01_Common";
uiInfo.assetName = "com_broadcast1";
uiInfo.layerType = UILayerType.Top;
uiInfo.isNeedOpenAnim = false;
uiInfo.isNeedCloseAnim = false;
uiInfo.isNeedUIMask = false;
}
#region
protected override void OnInit()
{
}
protected override void OnClose()
{
HallManager.Instance.UpdateSecondEvent -= timeEvent;
}
protected override void OnBind()
{
ui = baseUI as FGUI.P01_Common.com_broadcast1;
}
protected override void OnOpenBefore(object args)
{
InitView();
//ui.y = 241;
if (UIManager.Instance.IsExistUI(UIConst.RainPlayUI))
{
Setbuttom();
}
else
{
Settop();
}
// ui.visible = false;
// if (Screen.safeArea.y != 0)
// {//刘海屏
// ui.y += Screen.safeArea.y;
// }
text_ui = ui.broad_cast_text;
ui.btn_record.SetClick(OpenRecord);
ui.broad_cast_text.btn_broad.SetClick(OpenRecord);
if (ConfigSystem.GetConfig<exBrPoolModel>() == null) return;
config_name_list = ConfigSystem.GetConfig<exBrPoolModel>().config_name_list;
config_money_list = ConfigSystem.GetConfig<exBrPoolModel>().config_money_list;
GameDispatcher.Instance.AddListener(GameMsg.hideBroadCast, hideEvent);
GameDispatcher.Instance.AddListener(GameMsg.showBroadCast, showEvent);
UICtrlDispatcher.Instance.AddListener(UICtrlMsg.MainUI_Open, Settop);
UICtrlDispatcher.Instance.AddListener(UICtrlMsg.RainPlayUI_Open, Setbuttom);
}
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 int time_count = 11;
private com_broadcast_text1 text_ui;
private List<string> config_name_list;
private List<string> config_money_list;
private bool main_ui_show = true;
//初始化页面逻辑
private Action closeCallback = null;
private void InitView()
{
HallManager.Instance.UpdateSecondEvent += timeEvent;
var sk = FXManager.Instance.SetFx<SkeletonAnimation>(ui.broad_cast_text.bg_panel, Fx_Type.fx_broad, ref closeCallback);
sk.state.SetAnimation(0, "animation", true);
}
private void OpenRecord()
{
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.RecordViewUI_Open);
}
private void hideEvent(object sender = null)
{
Debug.Log("hide");
main_ui_show = false;
ui.visible = false;
}
private void showEvent(object sender = null)
{
Debug.Log("show");
main_ui_show = true;
ui.visible = true;
}
private void Settop(object sender = null)
{
ui.group_.y = 578;
// if (Screen.safeArea.y != 0)
// {//刘海屏
// ui.group_.y += Screen.safeArea.y;
// }
}
private void Setbuttom(object sender = null)
{
//ui.group_.y = GRoot.inst.height - 300;
ui.group_.y = 431;
if (Screen.safeArea.y != 0)
{//刘海屏
ui.group_.y += Screen.safeArea.y;
}
}
void timeEvent()
{
time_count++;
// if (time_count > 30)
// {
// time_count = 0;
// var name_index = UnityEngine.Random.Range(0, config_name_list.Count);
// var money_index = UnityEngine.Random.Range(0, config_money_list.Count);
// if (main_ui_show)
// {
// ui.visible = true;
// }
// Debug.Log(text_ui.cast_text.text);
// text_ui.cast_text.text = String.Format(text_ui.hide_text.text, config_name_list[name_index],
// config_money_list[money_index], DateTimeManager.Instance.GetCurrDateTime());
// text_ui.cast_text.x = 686;
// Tweener tweener = DOTween.To(() => text_ui.cast_text.x,
// x => text_ui.cast_text.x = x, -1300, 10);
// }
// time_count = 0;
//Debug.Log($"barry broad time count======== {time_count}");
if (time_count > 20)
{
time_count = 0;
var name_index = UnityEngine.Random.Range(0, config_name_list.Count);
var money_index = UnityEngine.Random.Range(0, config_money_list.Count);
Debug.Log(text_ui.cast_text.text);
string name = config_name_list[name_index];
if (name.Length > 4)
{
name = name[..4] + "...";
}
text_ui.hide_text.text = GameHelper.getDesByKey("makeup_4");
string broad_text = String.Format(text_ui.hide_text.text, name,
config_money_list[money_index], DateTimeManager.Instance.GetCurrDateTime());
text_ui.cast_text.text = broad_text;
ui.t0.Play();
if (AudioManager.Instance.IsOpenEffect)
{
AudioManager.Instance.PlayDynamicEffect(AudioConst.BroadTips);
}
DOVirtual.DelayedCall(3.5f, () =>
{
// Tweener tweener = DOTween.To(() => ui.broad.x,
// x => ui.broad.x = x, 1080, 0.5f);
ui.t1.Play();
});
string str = name + "-" + config_money_list[money_index] + "-" + DateTimeManager.Instance.GetCurrDateTime();
GameDispatcher.Instance.Dispatch(GameMsg.updateRecordList, str);
}
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d9a4125b4c0c64c94857a7ac85479526
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,77 @@
using System.Collections;
using System.Collections.Generic;
namespace FlowerPower
{
public class BroadcastUICtrl : BaseUICtrl
{
private BroadcastUI ui;
private BroadcastModel model;
private uint openUIMsg = UICtrlMsg.BroadcastUI_Open;
private uint closeUIMsg = UICtrlMsg.BroadcastUI_Close;
#region
protected override void OnInit()
{
//model = ModuleManager.Instance.GetModel(ModelConst.BroadcastModel) as BroadcastModel;
}
protected override void OnDispose()
{
}
public override void OpenUI(object args = null)
{
if (ui == null)
{
ui = new BroadcastUI(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: 35a4fff4d50cc4404951bdbed6e43b22
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c003c40f534c48c4eb6cab621e82134d
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,19 @@
namespace FlowerPower
{
public class BuyConfirmCtrl : BaseCtrl
{
public static BuyConfirmCtrl Instance { get; private set; }
private BuyConfirmCtrl model;
protected override void OnInit()
{
Instance = this;
}
protected override void OnDispose()
{
Instance = null;
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 7dbfdda822c575a4781a16e0d287bba7
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,15 @@
namespace FlowerPower
{
public class BuyConfirmModel : BaseModel
{
protected override void OnInit()
{
}
protected override void OnDispose()
{
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 5b29a35cdab494a41af5a4c88555751c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,111 @@
using System;
using System.Collections.Generic;
using DG.Tweening;
using FlowerPower;
using UnityEngine;
namespace FlowerPower
{
public class BuyConfirmUI : BaseUI
{
private BuyConfirmUICtrl ctrl;
private BuyConfirmModel model;
private FGUI.P18_ShopView.com_buy_confirm ui;
private AdRdData m_data;
private List<Paidgift> PaidgiftList;
private List<Paidcoins> list;
public BuyConfirmUI(BuyConfirmUICtrl ctrl) : base(ctrl)
{
uiName = UIConst.BuyConfirmUI;
this.ctrl = ctrl;
}
protected override void SetUIInfo(UIInfo uiInfo)
{
uiInfo.packageName = "P18_ShopView";
uiInfo.assetName = "com_buy_confirm";
uiInfo.layerType = UILayerType.Popup;
uiInfo.isNeedOpenAnim = false;
uiInfo.isNeedCloseAnim = false;
uiInfo.isNeedUIMask = true;
}
protected override void OnInit()
{
}
protected override void OnClose()
{
CommonHelper.FadeOut(ui);
}
protected override void OnBind()
{
ui = baseUI as FGUI.P18_ShopView.com_buy_confirm;
}
protected override void OnOpenBefore(object args)
{
m_data = (AdRdData)args;
PaidgiftList = ConfigSystem.GetConfig<PaidgiftModel>().dataList;
if (m_data.type == PurchasingManager.remove_ad) {
ui.state.selectedIndex = 1;
ui.lab_coin.text = "x " + PaidgiftList[1].coins_quantity;
} else if (m_data.type.StartsWith("buy_gold")) {
ui.state.selectedIndex = 0;
list = ConfigSystem.GetConfig<PaidcoinsModel>().dataList;
int startIndex = "buy_gold".Length;
string suffix = m_data.type[startIndex..]; // 截取 "gold" 后的所有字符
int suffix_num = int.Parse(suffix);
ui.lab_coin.text = GameHelper.Get101Str(list[suffix_num].Actual_coins);
} else if (m_data.type == PurchasingManager.pack_reward) {
ui.state.selectedIndex = 2;
ui.lab_coin.text = "x " + PaidgiftList[0].coins_quantity;
ui.lab_revoke.text = "x " + PaidgiftList[0].props_quantity[1];
ui.lab_refresh.text = "x " + PaidgiftList[0].props_quantity[2];
ui.lab_remove.text = "x " + PaidgiftList[0].props_quantity[0];
}
int myAdNum = AdRdManager.Instance.GetLookRewardADNum();
ui.lab_des.SetVar("num", m_data.ad_count.ToString()).FlushVars();
ui.lab_have_ads.SetVar("num", myAdNum.ToString()).FlushVars();
ui.btn_close.SetClick(() => { UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.BuyConfirmUI_Close); });
ui.btn_no_thanks.SetClick(() => { UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.BuyConfirmUI_Close); });
ui.btn_continue.SetClick(() => {
AdRdManager.Instance.SetLookRewardADNum(myAdNum - m_data.ad_count);
AdRdManager.Instance.SendEventClickByName(m_data.type, "success");
GameDispatcher.Instance.Dispatch(GameMsg.apple_pay_success, m_data.type);
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.BuyConfirmUI_Close);
});
}
protected override void OnOpen(object args)
{
CommonHelper.FadeIn(ui);
}
protected override void AddListener()
{
}
protected override void RemoveListener()
{
}
private void InitView()
{
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 03ed3e3011c9ac649a6e6854de3334fd
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,60 @@
namespace FlowerPower
{
public class BuyConfirmUICtrl : BaseUICtrl
{
private BuyConfirmUI ui;
private BuyConfirmModel model;
private uint openUIMsg = UICtrlMsg.BuyConfirmUI_Open;
private uint closeUIMsg = UICtrlMsg.BuyConfirmUI_Close;
protected override void OnInit()
{
}
protected override void OnDispose()
{
}
public override void OpenUI(object args = null)
{
if (ui == null)
{
ui = new BuyConfirmUI(this);
ui.Open(args);
}
}
public override void CloseUI(object args = null)
{
if (ui != null && !ui.isClose)
{
ui.Close();
}
ui = null;
}
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);
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: da3cdb5285c9e874096d91d9824f1e6e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b3a59974b3d5f6d49b4e54ed7605922c
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,42 @@
namespace FlowerPower
{
public class BuyPropCtrl : BaseCtrl
{
public static BuyPropCtrl Instance { get; private set; }
private BuyPropModel model;
#region
protected override void OnInit()
{
Instance = this;
//model = ModuleManager.Instance..GetModel(ModelConst.BuyPropModel) as BuyPropModel;
}
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: 58e27508a01b144eab047fc0579e3520
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,43 @@
namespace FlowerPower
{
public class BuyPropModel : 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: 6f1d88ea5dfa34e1a927e5bef7f9c714
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,163 @@
using System;
using FGUI.P01_Common;
namespace FlowerPower
{
public class BuyPropUI : BaseUI
{
private BuyPropUICtrl ctrl;
private BuyPropModel model;
private FGUI.P09_ChooseProp.com_prop ui;
private int state_ = 0;
public BuyPropUI(BuyPropUICtrl ctrl) : base(ctrl)
{
uiName = UIConst.BuyPropUI;
this.ctrl = ctrl;
}
private btn_watchAd btn_watchAd;
protected override void SetUIInfo(UIInfo uiInfo)
{
uiInfo.packageName = "P09_ChooseProp";
uiInfo.assetName = "com_prop";
uiInfo.layerType = UILayerType.Popup;
uiInfo.isNeedOpenAnim = false;
uiInfo.isNeedCloseAnim = false;
uiInfo.isNeedUIMask = true;
}
#region
protected override void OnInit()
{
//model = ModuleManager.Instance.GetModel(ModelConst.BuyPropModel) as BuyPropModel;
}
protected override void OnClose()
{
GameHelper.showGameUI = true;
HallManager.Instance.UpdateSecondEvent -= SetWatchBtnCd;
}
protected override void OnBind()
{
ui = baseUI as FGUI.P09_ChooseProp.com_prop;
}
protected override void OnOpenBefore(object args)
{
btn_watchAd = ui.btn_watch as btn_watchAd;
state_ = (int)args;
ui.prop.selectedIndex = state_;
ui.btn_buy.GetChild("text_gold").text = GameHelper.Get101Str(ConfigSystem.GetConfig<CommonModel>().Purchaseprops);
ui.btn_buy.SetClick(buyItem);
if (GameHelper.IsGiftSwitch() && ConfigSystem.GetConfig<CommonModel>().PiggyBankSwitch == 1) btn_watchAd.img_saveingpot.visible = true;
btn_watchAd.SetClick(() =>
{
GameHelper.ShowVideoAd("buy_prop", isSuccess =>
{
if (isSuccess)
{
GameHelper.SetWatchCd(state_);
BuyPropSuccess();
}
});
});
InitView();
HallManager.Instance.UpdateSecondEvent += SetWatchBtnCd;
SetWatchBtnCd();
}
void buyItem()
{
if (state_ == 0)
{
}
else if (state_ == 1)
{
}
else if (state_ == 2)
{
}
if (GameHelper.CheckGoldNumber(ConfigSystem.GetConfig<CommonModel>().Purchaseprops))
{
BuyPropSuccess();
}
else
{
GameHelper.ShowTips("Not enough gold");
}
}
private void BuyPropSuccess()
{
GameHelper.AddGoldNumber(-ConfigSystem.GetConfig<CommonModel>().Purchaseprops);
int numbers = GameHelper.GetItemNumber(state_);
numbers++;
GameHelper.SetItemNumber(state_, numbers);
GameDispatcher.Instance.Dispatch(GameMsg.Sheep_item_refresh);
GameDispatcher.Instance.Dispatch(GameMsg.Gold_refresh);
GameHelper.ShowTips("The purchase was successful", true);
CtrlCloseUI();
}
private void SetWatchBtnCd()
{
if (GameHelper.GetWatchCd(state_) > Convert.ToInt32(GameHelper.GetNowTime()))
{
btn_watchAd.can_buy.selectedIndex = 1;
btn_watchAd.btn_text.text = CommonHelper.TimeFormat(GameHelper.GetWatchCd(state_) - Convert.ToInt32(GameHelper.GetNowTime()), CountDownType.Hour);
btn_watchAd.enabled = false;
}
else
{
btn_watchAd.enabled = true;
btn_watchAd.can_buy.selectedIndex = 0;
}
}
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()
{
ui.btn_back.SetClick(() =>
{
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.SheepwindowUI_Close);
});
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d07e071d35d5041feaf834faa7cac3a0
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,71 @@
namespace FlowerPower
{
public class BuyPropUICtrl : BaseUICtrl
{
private BuyPropUI ui;
private BuyPropModel model;
private uint openUIMsg = UICtrlMsg.SheepwindowUI_Open;
private uint closeUIMsg = UICtrlMsg.SheepwindowUI_Close;
#region
protected override void OnInit()
{
//model = ModuleManager.Instance.GetModel(ModelConst.BuyPropModel) as BuyPropModel;
}
protected override void OnDispose()
{
}
public override void OpenUI(object args = null)
{
if (ui == null)
{
ui = new BuyPropUI(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: b85f17625775040eb85b386d6c9c5c79
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: cf8752ba62de0944699341c95ac0fdc8
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,42 @@
namespace FlowerPower
{
public class ChoosePropCtrl : BaseCtrl
{
public static ChoosePropCtrl Instance { get; private set; }
private ChoosePropModel model;
#region
protected override void OnInit()
{
Instance = this;
//model = ModuleManager.Instance..GetModel(ModelConst.ChoosePropModel) as ChoosePropModel;
}
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: 30f4147b6a9f34f8a98d5bbc0a788e6d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,43 @@
namespace FlowerPower
{
public class ChoosePropModel : 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: 24f4458949b044bf5ad0e021638528e0
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,190 @@
using FairyGUI;
using UnityEngine;
namespace FlowerPower
{
public class ChoosePropUI : BaseUI
{
private ChoosePropUICtrl ctrl;
private ChoosePropModel model;
private FGUI.P09_ChooseProp.com_choose ui;
public ChoosePropUI(ChoosePropUICtrl ctrl) : base(ctrl)
{
uiName = UIConst.ChoosePropUI;
this.ctrl = ctrl;
}
protected override void SetUIInfo(UIInfo uiInfo)
{
uiInfo.packageName = "P09_ChooseProp";
uiInfo.assetName = "com_choose";
uiInfo.layerType = UILayerType.Popup;
uiInfo.isNeedOpenAnim = false;
uiInfo.isNeedCloseAnim = false;
uiInfo.isNeedUIMask = true;
}
#region
protected override void OnInit()
{
//model = ModuleManager.Instance.GetModel(ModelConst.ChoosePropModel) as ChoosePropModel;
}
protected override void OnClose()
{
}
protected override void OnBind()
{
ui = baseUI as FGUI.P09_ChooseProp.com_choose;
}
protected override void OnOpenBefore(object args)
{
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()
{
// Debug.Log(GameHelper.GetLevelstate());
int state = GameHelper.GetLevelstate();
int need_gold = ConfigSystem.GetConfig<CommonModel>().RevivalCoins;
ui.btn_gold_buy.GetChild("text_gold").text = GameHelper.Get101Str(need_gold);
initProp(state);
if (GameHelper.IsGiftSwitch() && ConfigSystem.GetConfig<CommonModel>().PiggyBankSwitch == 1) (ui.btn_ad.GetChild("img_saveingpot") as GImage).visible = true;
ui.btn_thanks.SetClick(() =>
{
float[] ch_array = GameHelper.GetRewardValue(2);
var temp = new SuccessData();
temp.IsWin = false;
temp.ch_number = ch_array[0];
temp.IsLevelSuccess = true;
temp.IsH5Reward = false;
temp.boost_array=GameHelper.GetRewardBoost(2);
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.LevelSuccessUI_Open, temp);
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.ChoosePropUI_Close);
});
ui.btn_close.SetClick(() =>
{
float[] ch_array = GameHelper.GetRewardValue(2);
var temp = new SuccessData();
temp.IsWin = false;
temp.ch_number = ch_array[0];
temp.IsLevelSuccess = true;
temp.IsH5Reward = false;
temp.boost_array=GameHelper.GetRewardBoost(2);
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.LevelSuccessUI_Open, temp);
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.ChoosePropUI_Close);
});
}
private void initProp(int state)
{
int need_gold = ConfigSystem.GetConfig<CommonModel>().RevivalCoins;
if (state == 3)
{
ui.state.selectedIndex = ui._State_all_;
ui.btn_ad.SetClick(() =>
{
GameHelper.ShowVideoAd("reward_lobby", isSuccess =>
{
if (isSuccess)
{
GameHelper.SetLevelstate(1);
GameDispatcher.Instance.Dispatch(GameMsg.Remake_state, true);
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.ChoosePropUI_Close);
}
});
});
ui.btn_gold_buy.SetClick(() =>
{
if (GameHelper.CheckGoldNumber(need_gold))
{
GameHelper.AddGoldNumber(-need_gold);
GameHelper.SetLevelstate(2);
GameDispatcher.Instance.Dispatch(GameMsg.Remake_state, true);
GameDispatcher.Instance.Dispatch(GameMsg.Gold_refresh);
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.ChoosePropUI_Close);
}
else
{
GameHelper.ShowTips("Not enough gold");
}
});
}
else if (state == 2)
{
ui.state.selectedIndex = ui._State_ad;
ui.btn_ad.SetClick(() =>
{
GameHelper.ShowVideoAd("reward_lobby", isSuccess =>
{
if (isSuccess)
{
GameHelper.SetLevelstate(0);
GameDispatcher.Instance.Dispatch(GameMsg.Remake_state, true);
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.ChoosePropUI_Close);
}
});
});
}
else if (state == 1)
{
ui.state.selectedIndex = ui._State_gold;
ui.btn_gold_buy.SetClick(() =>
{
if (GameHelper.CheckGoldNumber(need_gold))
{
GameHelper.AddGoldNumber(-need_gold);
GameHelper.SetLevelstate(0);
GameDispatcher.Instance.Dispatch(GameMsg.Remake_state, true);
GameDispatcher.Instance.Dispatch(GameMsg.Gold_refresh);
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.ChoosePropUI_Close);
}
else
{
GameHelper.ShowTips("Not enough gold");
}
});
}
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 05d11be9302224ba99cc14d10974266f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,71 @@
namespace FlowerPower
{
public class ChoosePropUICtrl : BaseUICtrl
{
private ChoosePropUI ui;
private ChoosePropModel model;
private uint openUIMsg = UICtrlMsg.ChoosePropUI_Open;
private uint closeUIMsg = UICtrlMsg.ChoosePropUI_Close;
#region
protected override void OnInit()
{
//model = ModuleManager.Instance.GetModel(ModelConst.ChoosePropModel) as ChoosePropModel;
}
protected override void OnDispose()
{
}
public override void OpenUI(object args = null)
{
if (ui == null)
{
ui = new ChoosePropUI(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: d012c092edd6c41a2bbbed3c72ca2bfe
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b05bab87ee5860d45b1e0e643cda6b64
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 3aae7ebf11eadaf4a958264cdaa84eb2
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
+25
View File
@@ -0,0 +1,25 @@
namespace FlowerPower
{
public class FAQCtrl : BaseCtrl
{
public static FAQCtrl Instance { get; private set; }
private FAQModel model;
#region
protected override void OnInit()
{
Instance = this;
//model = ModuleManager.Instance..GetModel(ModelConst.FAQModel) as FAQModel;
}
protected override void OnDispose()
{
Instance = null;
}
#endregion
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 141317c3032f4463da09be3c37e26ba8
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+20
View File
@@ -0,0 +1,20 @@
namespace FlowerPower
{
public class FAQModel : BaseModel
{
#region
protected override void OnInit()
{
}
protected override void OnDispose()
{
}
#endregion
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 83f9eb69747b240dcb54855ff322ac86
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+240
View File
@@ -0,0 +1,240 @@
using UnityEngine;
using FairyGUI;
using Newtonsoft.Json;
using System.Collections.Generic;
using FGUI.P06_Hall;
namespace FlowerPower
{
public class FAQUI : BaseUI
{
private FAQUICtrl ctrl;
private FAQModel model;
private FGUI.P06_Hall.com_faq ui;
public FAQUI(FAQUICtrl ctrl) : base(ctrl)
{
uiName = UIConst.FAQUI;
this.ctrl = ctrl;
}
protected override void SetUIInfo(UIInfo uiInfo)
{
uiInfo.packageName = "P06_Hall";
uiInfo.assetName = "com_faq";
uiInfo.layerType = UILayerType.Popup;
uiInfo.isNeedOpenAnim = false;
uiInfo.isNeedCloseAnim = false;
uiInfo.isNeedUIMask = true;
}
#region
protected override void OnInit()
{
//model = ModuleManager.Instance.GetModel(ModelConst.FAQModel) as FAQModel;
}
protected override void OnClose()
{
}
protected override void OnBind()
{
ui = baseUI as FGUI.P06_Hall.com_faq;
}
protected override void OnOpenBefore(object args)
{
Debug.Log(JsonConvert.SerializeObject(ConfigSystem.GetConfig<FAQRuleModel>().dataList));
Debug.Log(JsonConvert.SerializeObject(ConfigSystem.GetConfig<MessageBoardModel>().dataList));
if (GameHelper.isRDExchangeMode())
{
rule_list = ConfigSystem.GetConfig<FAQRuleModel_1>().dataList;
message_list = ConfigSystem.GetConfig<MessageBoardModel_1>().dataList;
}
else
{
rule_list = ConfigSystem.GetConfig<FAQRuleModel>().dataList;
message_list = ConfigSystem.GetConfig<MessageBoardModel>().dataList;
}
InitView();
}
private List<FAQRule> rule_list = ConfigSystem.GetConfig<FAQRuleModel>().dataList;
private List<MessageBoard> message_list = ConfigSystem.GetConfig<MessageBoardModel>().dataList;
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.faq_refresh, refreshList);
}
protected override void RemoveListener()
{
GameDispatcher.Instance.RemoveListener(GameMsg.faq_refresh, refreshList);
}
#endregion
void refreshList(object a)
{
com_msg com_msg = (com_msg)UIPackage.CreateObject("P06_Hall", "com_msg");
com_msg.text_msg.text = list_user_arr[list_user_arr.Count - 1] + ":" + list_content_arr[list_content_arr.Count - 1];
ui.list_msg.AddChild(com_msg);
ui.list_msg.scrollPane.ScrollDown(500, false);
}
//初始化页面逻辑
private void InitView()
{
ui.btn_close.SetClick(CtrlCloseUI);
for (int i = 0; i < rule_list.Count; i++)
{
com_question question = (com_question)UIPackage.CreateObject("P06_Hall", "com_question");
question.text_question.text = (i + 1) + "." + rule_list[i].Rule;
if (question.text_question.width > 730) {
question.text_question.autoSize = AutoSizeType.Shrink;
question.text_question.width = 730;
}
ui.list_faq.AddChild(question);
for (int j = 0; j < 4; j++)
{
if (j == 0)
{
if (!string.IsNullOrEmpty(rule_list[i].Information1))
{
com_answer anster = (com_answer)UIPackage.CreateObject("P06_Hall", "com_answer");
anster.text_answer.text = rule_list[i].Information1;
ui.list_faq.AddChild(anster);
}
}
else if (j == 1)
{
if (!string.IsNullOrEmpty(rule_list[i].Information2))
{
com_answer anster = (com_answer)UIPackage.CreateObject("P06_Hall", "com_answer");
anster.text_answer.text = rule_list[i].Information2;
ui.list_faq.AddChild(anster);
}
}
else if (j == 2)
{
if (!string.IsNullOrEmpty(rule_list[i].Information3))
{
com_answer anster = (com_answer)UIPackage.CreateObject("P06_Hall", "com_answer");
anster.text_answer.text = rule_list[i].Information3;
ui.list_faq.AddChild(anster);
}
}
else if (j == 3)
{
if (!string.IsNullOrEmpty(rule_list[i].Information4))
{
com_answer anster = (com_answer)UIPackage.CreateObject("P06_Hall", "com_answer");
anster.text_answer.text = rule_list[i].Information4;
ui.list_faq.AddChild(anster);
}
}
}
}
if (user_arr == null) //第一次显示
{
user_arr = message_list[0].user_name.Split(",");
int user_index = PlayerPrefs.GetInt("user_index", 0);
if (user_index + 10 >= user_arr.Length) user_index = 0;
content_arr = message_list[0].message.Split(",");
int faq_index = PlayerPrefs.GetInt("faq_index", 0);
if (faq_index + 10 >= content_arr.Length) faq_index = 0;
for (int i = user_index; i < user_index + 10; i++)
{
list_user_arr.Add(user_arr[i]);
}
for (int i = faq_index; i < faq_index + 10; i++)
{
list_content_arr.Add(content_arr[i]);
}
if (PlayerPrefs.GetInt("user_FAQindex", 0) < 10)
{
if (!string.IsNullOrEmpty(PlayerPrefs.GetString("user_FAQcontent", "")))
{
list_user_arr.Insert(10 - PlayerPrefs.GetInt("user_FAQindex", 0), PreferencesMgr.Instance.PlayerName);
list_content_arr.Insert(10 - PlayerPrefs.GetInt("user_FAQindex", 0), PlayerPrefs.GetString("user_FAQcontent", ""));
}
}
user_index += 10;
faq_index += 10;
PlayerPrefs.SetInt("user_index", user_index);
PlayerPrefs.SetInt("faq_index", faq_index);
}
for (int i = 0; i < list_user_arr.Count; i++)
{
com_msg com_msg = (com_msg)UIPackage.CreateObject("P06_Hall", "com_msg");
com_msg.text_msg.text = list_user_arr[i] + ":" + list_content_arr[i];
ui.list_msg.AddChild(com_msg);
}
ui.btn_send.SetClick(() =>
{
if (string.IsNullOrEmpty(ui.input_msg.text)) {
GameHelper.ShowTips("Please enter your message!");
return;
}
Debug.Log(ui.input_msg.text);
com_msg com_msg = (com_msg)UIPackage.CreateObject("P06_Hall", "com_msg");
com_msg.text_msg.text = PreferencesMgr.Instance.PlayerName + ":" + ui.input_msg.text;
list_user_arr.Add(PreferencesMgr.Instance.PlayerName);
list_content_arr.Add(ui.input_msg.text);
PlayerPrefs.SetInt("faq_time", (int)GameHelper.GetNowTime());
PlayerPrefs.SetInt("user_FAQindex", 0);
PlayerPrefs.SetString("user_FAQcontent", ui.input_msg.text);
ui.input_msg.text = "";
ui.input_msg.promptText = "[color=#999999][size=40]Can only send once every hour[/size][/color]";
ui.input_msg.touchable = false;
ui.btn_send.SetClick(() => { });
ui.list_msg.AddChild(com_msg);
ui.list_msg.scrollPane.ScrollDown(500, false);
ui.btn_send.grayed = true;
ui.input_bg.grayed = true;
});
ui.list_msg.scrollPane.ScrollDown(1000, false);
if (PlayerPrefs.GetInt("faq_time", 0) + 3600 > GameHelper.GetNowTime())
{
ui.input_msg.promptText = "[color=#999999][size=40]Can only send once every hour[/size][/color]";
ui.input_msg.touchable = false;
ui.btn_send.SetClick(() => { });
ui.btn_send.grayed = true;
ui.input_bg.grayed = true;
}
ui.btn_contactus.SetClick(() => { GameHelper.OpenEmail(); });
}
public static string[] user_arr;
public static string[] content_arr;
public static List<string> list_user_arr = new List<string>();
public static List<string> list_content_arr = new List<string>();
}
}
+11
View File
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 5a9bee451b15a47eaaa4a44e93ccba93
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+157
View File
@@ -0,0 +1,157 @@
using System.Collections.Generic;
using UnityEngine;
namespace FlowerPower
{
public class FAQUICtrl : BaseUICtrl
{
private FAQUI ui;
private FAQModel model;
private uint openUIMsg = UICtrlMsg.FAQUI_Open;
private uint closeUIMsg = UICtrlMsg.FAQUI_Close;
#region
protected override void OnInit()
{
//model = ModuleManager.Instance.GetModel(ModelConst.FAQModel) as FAQModel;
}
protected override void OnDispose()
{
}
public override void OpenUI(object args = null)
{
if (ui == null)
{
ui = new FAQUI(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);
HallManager.Instance.UpdateSecondEvent += timeEvent;
}
protected override void RemoveListener()
{
uiCtrlDispatcher.RemoveListener(openUIMsg, OpenUI);
uiCtrlDispatcher.RemoveListener(closeUIMsg, CloseUI);
}
protected override void AddServerListener()
{
}
protected override void RemoveServerListener()
{
}
private int time = 0;
private int refresh_time=5;
void timeEvent()
{
time++;
// Debug.Log((int)GameHelper.GetNowTime());
if (FAQUI.user_arr == null&&time > refresh_time) //第一次显示
{
List<MessageBoard> message_list = ConfigSystem.GetConfig<MessageBoardModel>().dataList;
FAQUI.user_arr = message_list[0].user_name.Split(",");
int user_index = PlayerPrefs.GetInt("user_index", 0);
if (user_index + 10 >= FAQUI.user_arr.Length) user_index = 0;
FAQUI.content_arr = message_list[0].message.Split(",");
int faq_index = PlayerPrefs.GetInt("faq_index", 0);
if (faq_index + 10 >= FAQUI.content_arr.Length) faq_index = 0;
for (int i = user_index; i < user_index + 10; i++)
{
FAQUI.list_user_arr.Add(FAQUI.user_arr[i]);
}
for (int i = faq_index; i < faq_index + 10; i++)
{
FAQUI.list_content_arr.Add(FAQUI.content_arr[i]);
}
if (PlayerPrefs.GetInt("user_FAQindex", 0) < 10)
{
if (!string.IsNullOrEmpty(PlayerPrefs.GetString("user_FAQcontent", "")))
{
FAQUI.list_user_arr.Insert(10 - PlayerPrefs.GetInt("user_FAQindex", 0), PreferencesMgr.Instance.PlayerName);
FAQUI.list_content_arr.Insert(10 - PlayerPrefs.GetInt("user_FAQindex", 0), PlayerPrefs.GetString("user_FAQcontent", ""));
}
}
user_index += 10;
faq_index += 10;
PlayerPrefs.SetInt("user_index", user_index);
PlayerPrefs.SetInt("faq_index", faq_index);
}
if (time > refresh_time)
{
time = 0;
int user_index = PlayerPrefs.GetInt("user_index", 0);
// Debug.Log(user_index);
// Debug.Log(FAQUI.user_arr);
// Debug.Log(FAQUI.user_arr.Length);
if (user_index + 1 >= FAQUI.user_arr.Length) user_index = 0;
int faq_index = PlayerPrefs.GetInt("faq_index", 0);
if (faq_index + 1 >= FAQUI.content_arr.Length) faq_index = 0;
FAQUI.list_user_arr.Add(FAQUI.user_arr[user_index]);
FAQUI.list_content_arr.Add(FAQUI.content_arr[faq_index]);
if (FAQUI.list_user_arr.Count > 50)
{
FAQUI.list_user_arr.RemoveAt(0);
}
if (FAQUI.list_content_arr.Count > 50)
{
FAQUI.list_content_arr.RemoveAt(0);
}
user_index++;
faq_index++;
PlayerPrefs.SetInt("user_FAQindex", PlayerPrefs.GetInt("user_FAQindex", 0) + 1);
PlayerPrefs.SetInt("user_index", user_index);
PlayerPrefs.SetInt("faq_index", faq_index);
GameDispatcher.Instance.Dispatch(GameMsg.faq_refresh);
}
}
#endregion
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c21a94c563a4b4e1f8aebe5935b398c0
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 88b71acc77eae444ca3b0a7275fa9c88
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,44 @@
namespace FlowerPower
{
public class FXWndCtrl : BaseCtrl
{
public static FXWndCtrl Instance { get; private set; }
private FXWndModel model;
#region
protected override void OnInit()
{
Instance = this;
}
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,3 @@
fileFormatVersion: 2
guid: 4ba389480d8644e5bb9fae2d8eb324f0
timeCreated: 1671086538
@@ -0,0 +1,51 @@
namespace FlowerPower
{
public class FXWndModel : 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,3 @@
fileFormatVersion: 2
guid: c48389d259bf411e80143844af2b2591
timeCreated: 1671086538
+192
View File
@@ -0,0 +1,192 @@
using System;
using DG.Tweening;
using UnityEngine;
using FairyGUI;
using Spine.Unity;
namespace FlowerPower
{
public class FXWndUI : BaseUI
{
private FXWndUICtrl ctrl;
private FXWndModel model;
private FGUI.P502_Fx.com_FX ui;
private Transform parTrf;
public FXWndUI(FXWndUICtrl ctrl) : base(ctrl)
{
uiName = UIConst.FXWndUI;
this.ctrl = ctrl;
}
protected override void SetUIInfo(UIInfo uiInfo)
{
uiInfo.packageName = "P502_Fx";
uiInfo.assetName = "com_FX";
uiInfo.layerType = UILayerType.Animation;
}
public void PlayFx(FxPlayData fxPlayData)
{
FxPlayData data = fxPlayData;
GameObject arg = null;
Transform trf = null;
Action recFx = null;
if (data.isParticleSystem)
{
ParticleSystem system = FXManager.Instance.GetFx<ParticleSystem>(data.fxType);
system.Play();
arg = system.gameObject;
trf = system.transform;
recFx = delegate { FXManager.Instance.RecFx<ParticleSystem>(data.fxType, system); };
}
else
{
SkeletonAnimation system = FXManager.Instance.GetFx<SkeletonAnimation>(data.fxType);
trf = system.transform;
arg = system.gameObject;
recFx = delegate { FXManager.Instance.RecFx<SkeletonAnimation>(data.fxType, system); };
}
trf.SetParent(parTrf);
arg.SetLayer("UI");
Action cb = SetSortingOrder(arg);
data.endEvent += (e) => cb?.Invoke();
Vector3 startPot = GameHelper.FguiPotToUnityTrfLocalPot(data.startPot);
trf.localPosition = startPot;
trf.localScale = Vector3.one * data.size;
trf.localEulerAngles = Vector3.zero;
fxPlayData.startEvent?.Invoke(arg);
DOVirtual.DelayedCall(data.duration, () =>
{
data.endEvent?.Invoke(arg);
recFx?.Invoke();
FxPlayData.Release(data);
});
}
private Action SetSortingOrder(GameObject obj)
{
Action action = null;
Renderer[] renders = obj.GetComponentsInChildren<Renderer>();
foreach (Renderer render in renders)
{
if (render != null)
{
render.sortingOrder += 300;
action += () => { render.sortingOrder -= 300; };
}
}
return action;
}
#region
protected override void OnInit()
{
}
protected override void OnClose()
{
}
protected override void OnBind()
{
ui = baseUI as FGUI.P502_Fx.com_FX;
}
protected override void OnOpenBefore(object args)
{
parTrf = ui.displayObject.cachedTransform;
}
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
}
public class FxPlayData
{
private static ObjectPool<FxPlayData> _Pool = new ObjectPool<FxPlayData>();
public static FxPlayData Get(Fx_Type fx_Type, float _duration, Vector2 _pot)
{
FxPlayData data = _Pool.Get();
if (_pot == Vector2.zero)
{
data.startPot = GRoot.inst.size / 2;
}
else
{
data.startPot = _pot;
}
if (_duration == 0)
{
data.duration = 1;
}
else
{
data.duration = _duration;
}
data.fxType = fx_Type;
return data;
}
public static void Release(FxPlayData data)
{
data.duration = 0;
data.startEvent = null;
data.endEvent = null;
data.isParticleSystem = true;
data.startPot = Vector2.zero;
_Pool.Release(data);
}
public float duration;
public Fx_Type fxType;
public bool isParticleSystem = true;
public Vector2 startPot;
public Action<GameObject> startEvent;
public Action<GameObject> endEvent;
public int size = 100;
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 57addc9545404bc9b81d1ffbe0d02508
timeCreated: 1671086538
@@ -0,0 +1,95 @@
namespace FlowerPower
{
public class FXWndUICtrl : BaseUICtrl
{
private FXWndUI ui;
private FXWndModel model;
private uint openUIMsg = UICtrlMsg.FXWndUI_Open;
private uint closeUIMsg = UICtrlMsg.FXWndUI_Close;
private bool isOpen = false;
#region
protected override void OnInit()
{
}
protected override void OnDispose()
{
}
public override void OpenUI(object args = null)
{
if (ui == null || ui.isClose)
{
ui = new FXWndUI(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);
uiCtrlDispatcher.AddListener(UICtrlMsg.PlayUIFX, PlayFx);
}
protected override void RemoveListener()
{
uiCtrlDispatcher.RemoveListener(openUIMsg, OpenUI);
uiCtrlDispatcher.RemoveListener(closeUIMsg, CloseUI);
uiCtrlDispatcher.RemoveListener(UICtrlMsg.PlayUIFX, PlayFx);
}
private void PlayFx(object obj)
{
if (!isOpen)
{
OpenUI();
}
FxPlayData fxType = (FxPlayData)obj;
ui.PlayFx(fxType);
}
protected override void AddServerListener()
{
}
protected override void RemoveServerListener()
{
}
#endregion
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: e43875b511c04a81a511ab1a4bdb6c5c
timeCreated: 1671086538
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: a6026fb838906f2419772b0ca9f743fa
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,42 @@
namespace FlowerPower
{
public class FirstRewardCtrl : BaseCtrl
{
public static FirstRewardCtrl Instance { get; private set; }
private FirstRewardModel model;
#region
protected override void OnInit()
{
Instance = this;
//model = ModuleManager.Instance..GetModel(ModelConst.FirstRewardModel) as FirstRewardModel;
}
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: 2b10e7a12f76b4e9c9389034c3bcee2c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,43 @@
namespace FlowerPower
{
public class FirstRewardModel : 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: 139c7e95f3a174f9f996d4aaf7465f2c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,158 @@
using System;
using UnityEngine;
// using FGUI.G002_main;
using Spine.Unity;
using DG.Tweening;
using FGUI.P06_Hall;
using FGUI.P01_Common;
namespace FlowerPower
{
public class FirstRewardUI : BaseUI
{
private FirstRewardUICtrl ctrl;
private FirstRewardModel model;
private FGUI.P06_Hall.com_first_award ui;
private Action closeCallback;
private Action open_sign;
private bool is_get = false;
public FirstRewardUI(FirstRewardUICtrl ctrl) : base(ctrl)
{
uiName = UIConst.FirstRewardUI;
this.ctrl = ctrl;
}
protected override void SetUIInfo(UIInfo uiInfo)
{
uiInfo.packageName = "P06_Hall";
uiInfo.assetName = "com_first_award";
uiInfo.layerType = UILayerType.Popup;
uiInfo.isNeedOpenAnim = false;
uiInfo.isNeedCloseAnim = false;
uiInfo.isNeedUIMask = true;
}
#region
protected override void OnInit()
{
model = ModuleManager.Instance.GetModel(ModelConst.FirstRewardModel) as FirstRewardModel;
}
protected override void OnClose()
{
closeCallback();
//open_sign();
}
protected override void OnBind()
{
ui = baseUI as FGUI.P06_Hall.com_first_award;
}
protected override void OnOpenBefore(object args)
{
if (Screen.safeArea.y != 0)
{//刘海屏
ui.money.y += Screen.safeArea.y;
}
InitView();
}
protected override void OnOpen(object args)
{
//open_sign = (System.Action)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()
{
// ui.money.GetChild("text_gold").text = $"{PreferencesMgr.Instance.Currency101:N0}";
ui.money.GetChild("btn_ch").visible = false;
com_money money = ui.money as com_money;
money.btn_ch.visible = false;
money.number_text.text = GameHelper.Get102Str();
ui.text_num.text = GameHelper.Get102Str(ConfigSystem.GetConfig<CommonModel>().InitialNum);
var sk = FXManager.Instance.SetFx<SkeletonAnimation>(ui.spine_parent, Fx_Type.fx_first_reward, ref closeCallback);
sk.state.SetAnimation(0, "newbie_reward_an01", false);
sk.state.Complete += (a) =>
{
sk.state.SetAnimation(0, "newbie_reward_an02", true);
ui.btn_getreward.SetClick(() =>
{
ui.btn_getreward.visible = false;
sk.state.SetAnimation(0, "newbie_reward_an03", false);
sk.state.Complete += (a) =>
{
ui.state.selectedIndex = com_first_award.State_page;
};
});
};
ui.btn_get.SetClick(GetReward);
ui.btn_close.SetClick(GetReward);
}
private void GetReward()
{
com_money money = ui.money as com_money;
if (is_get) return;
is_get = true;
var start = GameHelper.GetUICenterPosition(ui.img_money);
var end = GameHelper.GetUICenterPosition(ui.money.GetChild("icon"));
int awardNum = ConfigSystem.GetConfig<CommonModel>().InitialNum;
var rewardData = new RewardData();
var rewardSingleData = new RewardSingleData(102, awardNum, RewardOrigin.AdTask)
{
startPosition = start,
endPosition = new Vector2(end.x - 150, end.y - 136)
};
rewardData.AddReward(rewardSingleData);
rewardData.displayType = RewardDisplayType.RewardFly | RewardDisplayType.ValueChange;
rewardData.AddCompleted(success =>
{
if (success)
{
var startNum = PreferencesMgr.Instance.Currency102 - awardNum;
DOVirtual.Float((float)startNum, (float)PreferencesMgr.Instance.Currency102, 1,
value => { money.number_text.text = GameHelper.Get102Str((decimal)value); });
SaveData.GetSaveobject().isGetFirstGift = 1;
GameDispatcher.Instance.Dispatch(GameMsg.UpdateCurrency102);
DOVirtual.DelayedCall(1.5f, () =>
{
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.FirstRewardUI_Close);
});
}
});
GameDispatcher.Instance.Dispatch(GameMsg.GetReward, rewardData);
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 10ed78edd8a4f471d8230502a75e04f5
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,71 @@
namespace FlowerPower
{
public class FirstRewardUICtrl : BaseUICtrl
{
private FirstRewardUI ui;
private FirstRewardModel model;
private uint openUIMsg = UICtrlMsg.FirstRewardUI_Open;
private uint closeUIMsg = UICtrlMsg.FirstRewardUI_Close;
#region
protected override void OnInit()
{
//model = ModuleManager.Instance.GetModel(ModelConst.FirstRewardModel) as FirstRewardModel;
}
protected override void OnDispose()
{
}
public override void OpenUI(object args = null)
{
if (ui == null)
{
ui = new FirstRewardUI(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: 943432b7abe7d41eb9b023894a945fcf
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

Some files were not shown because too many files have changed in this diff Show More