fix:1、更换项目,使用winter来创建

This commit is contained in:
2026-04-22 11:13:16 +08:00
parent 173cfb2dc9
commit 83ff9f71ad
7375 changed files with 209752 additions and 157557 deletions
@@ -1,7 +1,7 @@
using System.Collections;
using System.Collections.Generic;
namespace FlowerPower
namespace LoveLegend
{
public class AdcomingCtrl : BaseCtrl
{
@@ -2,7 +2,7 @@ using System.Collections;
using System.Collections.Generic;
namespace FlowerPower
namespace LoveLegend
{
public class AdcomingModel : BaseModel
{
+6 -18
View File
@@ -5,13 +5,13 @@ using FutureCore;
using FairyGUI;
using DG.Tweening;
namespace FlowerPower
namespace LoveLegend
{
public class AdcomingUI : BaseUI
{
private AdcomingUICtrl ctrl;
private AdcomingModel model;
private FGUI.P17_PackAward.com_adcoming ui;
private FGUI.ZM_Pack_16.com_adcoming ui;
public AdcomingUI(AdcomingUICtrl ctrl) : base(ctrl)
{
@@ -21,7 +21,7 @@ namespace FlowerPower
protected override void SetUIInfo(UIInfo uiInfo)
{
uiInfo.packageName = "P17_PackAward";
uiInfo.packageName = "ZM_Pack_16";
uiInfo.assetName = "com_adcoming";
uiInfo.layerType = UILayerType.Popup;
uiInfo.isNeedOpenAnim = false;
@@ -41,7 +41,7 @@ namespace FlowerPower
protected override void OnBind()
{
ui = baseUI as FGUI.P17_PackAward.com_adcoming;
ui = baseUI as FGUI.ZM_Pack_16.com_adcoming;
}
protected override void OnOpenBefore(object args)
@@ -79,33 +79,21 @@ namespace FlowerPower
{
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 = DOVirtual.Float(time, 0, time, value => { ui.time_text.text = ((int)value).ToString(); });
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);
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.LuckyPackUI_Open,true);
tweer.Pause();
});
}
private Tween tweer;
private Tween tweer2;
void playAni(object a)
{
tweer.Play();
@@ -1,7 +1,7 @@
using System.Collections;
using System.Collections.Generic;
namespace FlowerPower
namespace LoveLegend
{
public class AdcomingUICtrl : BaseUICtrl
{
@@ -1,4 +1,4 @@
namespace FlowerPower
namespace LoveLegend
{
public class AddViewCtrl : BaseCtrl
{
@@ -1,4 +1,4 @@
namespace FlowerPower
namespace LoveLegend
{
public class AddViewModel : BaseModel
{
+31 -150
View File
@@ -1,20 +1,17 @@
using System;
using FGUI.P01_Common;
using FairyGUI;
using FGUI.ZM_Common_01;
using SGModule.NetKit;
using Spine.Unity;
using System.Collections.Generic;
using UnityEngine;
namespace FlowerPower
namespace LoveLegend
{
public class AddViewUI : BaseUI
{
private AddViewUICtrl ctrl;
private AddViewModel model;
private FGUI.P13_AddOne.com_addView ui;
private FGUI.ZM_AddCell_12.com_addView ui;
public int ad_cool_down = 120;
public btn_watchAd btn_WatchAd;
private Action closeCallback;
public AddViewUI(AddViewUICtrl ctrl) : base(ctrl)
{
@@ -24,7 +21,7 @@ namespace FlowerPower
protected override void SetUIInfo(UIInfo uiInfo)
{
uiInfo.packageName = "P13_AddOne";
uiInfo.packageName = "ZM_AddCell_12";
uiInfo.assetName = "com_addView";
uiInfo.layerType = UILayerType.Popup;
uiInfo.isNeedOpenAnim = false;
@@ -41,116 +38,54 @@ namespace FlowerPower
protected override void OnClose()
{
GameHelper.showGameUI = true;
HallManager.Instance.UpdateSecondEvent -= updateWatchCD;
// HallManager.Instance.UpdateSecondEvent -= updateWatchCD;
if (GameHelper.IsAdModelOfPay())
{
AdRdManager.Instance.Destroy();
AdExchangeManager.Instance.Destroy();
}
GameHelper.CallShowTurn();
if (need_call) GameHelper.CallShowTurn();
}
private bool need_call;
protected override void OnBind()
{
ui = baseUI as FGUI.P13_AddOne.com_addView;
ui = baseUI as FGUI.ZM_AddCell_12.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);
TrackKit.SendEvent(GameHelper.GetEventName(), ADEventTrack.Property.buy_one_show);
if (args != null) need_call = (bool)args;
// 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)
if (GameHelper.IsAdModelOfPay())
{
AdRdManager.Instance.SetWatchAd(PurchasingManager.buy_one, ui.btn_watch as btn_watchAd, SetTextString);
AdExchangeManager.Instance.SetWatchAd(PurchasingManager.GetPaySku(PayType.buy_one), ui.btn_watch as btn_watchAd, SetTextString);
ui.pay_type.selectedIndex = 0;
AdRdManager.Instance.Start();
AdExchangeManager.Instance.Start();
SetTextString();
}
else if (GameHelper.GetAddPayMode() == 0)
else
{
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,
sku =PurchasingManager.GetPaySku(PayType.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)
{
}
@@ -180,97 +115,43 @@ namespace FlowerPower
{
string type = (string)str;
if (type == PurchasingManager.buy_one)
if (type == PurchasingManager.GetPaySku(PayType.buy_one))
{
CtrlCloseUI();
}
}
private Action closeCallback = null;
//初始化页面逻辑
private void InitView()
{
var add = FXManager.Instance.SetFx<SkeletonAnimation>(ui.anim_bg, Fx_Type.fx_add_box, ref closeCallback);
add.state.SetAnimation(0, "animation", true);
ui.btn_close.SetClick(() =>
{
CtrlCloseUI();
GameDispatcher.Instance.Dispatch(GameMsg.resurgence_close);
});
HallManager.Instance.UpdateSecondEvent += updateWatchCD;
updateWatchCD();
InitBroadCast();
// HallManager.Instance.UpdateSecondEvent += updateWatchCD;
// updateWatchCD();
// 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();
var need = AdExchangeManager.Instance.GetCeilingNeedAds(PurchasingManager.GetPaySku(PayType.buy_one));
var myAd = AdExchangeManager.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!";
}
}
}
}
}
@@ -1,4 +1,4 @@
namespace FlowerPower
namespace LoveLegend
{
public class AddViewUICtrl : BaseUICtrl
{
@@ -1,234 +0,0 @@
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!";
}
}
}
}
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 4cc0dc1a5313d412a83b8e39a7efb8fc
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 046c52d08595a4040a001d8004b8875c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,247 +0,0 @@
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();
}
}
}
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 3b62f3687397048a0a4365a156cc3eac
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: a375bc5ca46a34c92bc7dfa4c493c980
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 3910c987440d8ea46846b1855bfcb7bc
guid: d0a3a471d4eab4205adfabe3e6e03dfa
folderAsset: yes
DefaultImporter:
externalObjects: {}
@@ -0,0 +1,25 @@
namespace LoveLegend
{
public class AlbumDetailCtrl : BaseCtrl
{
public static AlbumDetailCtrl Instance { get; private set; }
private AlbumDetailModel model;
#region
protected override void OnInit()
{
Instance = this;
//model = ModuleManager.Instance..GetModel(ModelConst.AlbumDetailModel) as AlbumDetailModel;
}
protected override void OnDispose()
{
Instance = null;
}
#endregion
}
}
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 0482db053a1ce45d989a2e4a715dff81
guid: 742a1554a1ce547a18f4d2fcde5d052a
MonoImporter:
externalObjects: {}
serializedVersion: 2
@@ -1,8 +1,8 @@
namespace FlowerPower
namespace LoveLegend
{
public class AddviewnewModel : BaseModel
public class AlbumDetailModel : BaseModel
{
#region
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 8927197c6cb1f412d83d93ded8cf1589
guid: a5b5cfda3c4d14dc6ab5ea147569f119
MonoImporter:
externalObjects: {}
serializedVersion: 2
@@ -0,0 +1,299 @@
using FGUI.ZM_Common_01;
using UnityEngine;
using FairyGUI;
using System.Collections.Generic;
using FGUI.LG_albums;
using FGUI.LG_Common;
using SGModule.DataStorage;
using DG.Tweening;
using SGModule.Common.Extensions;
using System.Linq;
using SGModule.NetKit;
namespace LoveLegend
{
public class AlbumDetailUI : BaseUI
{
private AlbumDetailUICtrl ctrl;
private AlbumDetailModel model;
private FGUI.LG_albums.com_albumsDetail ui;
public AlbumDetailUI(AlbumDetailUICtrl ctrl) : base(ctrl)
{
uiName = UIConst.AlbumDetailUI;
this.ctrl = ctrl;
}
protected override void SetUIInfo(UIInfo uiInfo)
{
uiInfo.packageName = "LG_albums";
uiInfo.assetName = "com_albumsDetail";
uiInfo.layerType = UILayerType.Popup;
uiInfo.isNeedOpenAnim = false;
uiInfo.isNeedCloseAnim = false;
uiInfo.isNeedUIMask = true;
}
#region
protected override void OnInit()
{
//model = ModuleManager.Instance.GetModel(ModelConst.AlbumDetailModel) as AlbumDetailModel;
}
protected override void OnClose()
{
if (loader != null && !loader.isDisposed && loader.texture != null)
{
loader.texture.Dispose();
loader.texture = null;
}
loader = null;
if (new_index != -1)
{
GameDispatcher.Instance.Dispatch(GameMsg.UnlockAlbums, index);
}
}
protected override void OnBind()
{
ui = baseUI as FGUI.LG_albums.com_albumsDetail;
}
private List<LevelUnlock> LevelData;
private int new_index = -1;
private int index;
private GLoader loader = new GLoader();
protected override void OnOpenBefore(object args)
{
index = (int)args;
Debug.Log(index);
ui.btn_close.SetClick(() =>
{
CtrlCloseUI();
});
LevelData = ConfigSystem.GetConfig<LevelUnlock>();
// ui.list_.SetVirtual();
// ui.list_.itemRenderer = RendererList;
// ui.list_.numItems = GameHelper.GetLevel() - 1;
// ui.list_.ScrollToView(new_index);
RendererList();
}
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.BuyVip, refrsh);
}
protected override void RemoveListener()
{
GameDispatcher.Instance.RemoveListener(GameMsg.BuyVip, refrsh);
}
#endregion
//初始化页面逻辑
private void refrsh(object a = null)
{
DOVirtual.DelayedCall(0.5f, () =>
{
// ui.list_.numItems = GameHelper.GetLevel() - 1;
RendererList();
});
}
// void RendererList(int index, GObject obj)
void RendererList()
{
item_albumsDetails item = (item_albumsDetails)ui.com_item;
loader = item.com_loader.GetChild("loader") as GLoader;
// if (GameHelper.GetVipPrivilege(Subscription.VipLevel.As<int>()))
// {
// (item.btn_vip as btn_claim_2).have_vip.selectedIndex = 1;
// }
// if (GameHelper.GetVipPrivilege(Subscription.SLVLevel.As<int>()))
// {
// (item.btn_watch as btn_claim_1).have_vip.selectedIndex = 1;
// }
var downloadCoinNum = ConfigSystem.GetCommonConf().CoinsDownload;
var btn_down_coin = (FGUI.LG_Common.btn_unlock_1)item.btn_download_coin;
btn_down_coin.title = downloadCoinNum.As<string>();
btn_down_coin.down_load.selectedIndex = GameHelper.GetVipPrivilege(Subscription.FreeDownImage.As<int>()) ? 0 : 1;
if (GameHelper.GetVipPrivilege(Subscription.FreeDownImage.As<int>()))
{
(item.btn_download as FGUI.LG_Common.btn_claim).have_vip.selectedIndex = 1;
item.is_vip.selectedIndex = 1;
}
else
{
item.is_vip.selectedIndex = 0;
}
if (index < GameHelper.GetCommonModel().MultiModal - 1)
{
TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, LevelData[index].Name, null, "LevelAlbums/", FolderNames.AlbumName);
item.btn_download.SetClick(() =>
{
if (GameHelper.GetVipPrivilege(Subscription.FreeDownImage.As<int>()))
{
TextureHelper.SaveImageToAlbum(LevelData[index].Name, FolderNames.AlbumName);
}
else
{
GameHelper.ShowVideoAd("DownloadImage", isSuccess =>
{
if (isSuccess)
{
TextureHelper.SaveImageToAlbum(LevelData[index].Name, FolderNames.AlbumName);
}
});
}
});
btn_down_coin.SetClick(() =>
{
if (GameHelper.Get101() >= downloadCoinNum)
{
GameHelper.AddGold(-downloadCoinNum);
TextureHelper.SaveImageToAlbum(LevelData[index].Name, FolderNames.AlbumName);
TrackKit.SendEvent(ADEventTrack.Coinsbuy, ADEventTrack.Property.download);
}
else
{
GameHelper.ShowTips("no_enough_gold", true);
uiCtrlDispatcher.Dispatch(UICtrlMsg.BuygoldUI_Open);
}
});
}
else
{
Levelunlock levelunlock_ = DataMgr.LevelUnlockListNew.Value.FirstOrDefault(x => x.level_ == index + 1);
string file_name = "";
if (levelunlock_ != null)
{
if (levelunlock_.type == 0)
{
if (levelunlock_.config_index >= ConfigSystem.GetConfig<FreeImageLibrary>().Count) levelunlock_.config_index = ConfigSystem.GetConfig<FreeImageLibrary>().Count - 1;
FreeImageLibrary _leveldata = ConfigSystem.GetConfig<FreeImageLibrary>()[levelunlock_.config_index];
TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, _leveldata.Name, null, "LevelAlbums/", FolderNames.AlbumName);
file_name = _leveldata.Name;
}
else if (levelunlock_.type == 1)
{
if (levelunlock_.config_index >= ConfigSystem.GetConfig<ADImageLibrary>().Count) levelunlock_.config_index = ConfigSystem.GetConfig<ADImageLibrary>().Count - 1;
ADImageLibrary _leveldata = ConfigSystem.GetConfig<ADImageLibrary>()[levelunlock_.config_index];
TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, _leveldata.Name, null, "LevelAlbums/", FolderNames.AlbumName);
file_name = _leveldata.Name;
}
else if (levelunlock_.type == 2)
{
if (levelunlock_.config_index >= ConfigSystem.GetConfig<SpecialImageLibrary>().Count) levelunlock_.config_index = ConfigSystem.GetConfig<SpecialImageLibrary>().Count - 1;
SpecialImageLibrary _leveldata = ConfigSystem.GetConfig<SpecialImageLibrary>()[levelunlock_.config_index];
TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, _leveldata.Name, null, "LevelAlbums/", FolderNames.AlbumName);
file_name = _leveldata.Name;
}
else if (levelunlock_.type == 3)
{
if (levelunlock_.config_index >= ConfigSystem.GetConfig<VIPImageLibrary>().Count) levelunlock_.config_index = ConfigSystem.GetConfig<VIPImageLibrary>().Count - 1;
VIPImageLibrary _leveldata = ConfigSystem.GetConfig<VIPImageLibrary>()[levelunlock_.config_index];
TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, _leveldata.Name, null, "LevelAlbums/", FolderNames.AlbumName);
file_name = _leveldata.Name;
}
item.btn_download.SetClick(() =>
{
if (GameHelper.GetVipPrivilege(Subscription.FreeDownImage.As<int>()))
{
TextureHelper.SaveImageToAlbum(file_name, FolderNames.AlbumName);
}
else
{
GameHelper.ShowVideoAd("DownloadImage", isSuccess =>
{
if (isSuccess)
{
TextureHelper.SaveImageToAlbum(file_name, FolderNames.AlbumName);
}
});
}
});
btn_down_coin.SetClick(() =>
{
if (GameHelper.Get101() >= downloadCoinNum)
{
GameHelper.AddGold(-downloadCoinNum);
TextureHelper.SaveImageToAlbum(file_name, FolderNames.AlbumName);
TrackKit.SendEvent(ADEventTrack.Coinsbuy, ADEventTrack.Property.download);
}
else
{
GameHelper.ShowTips("no_enough_gold", true);
uiCtrlDispatcher.Dispatch(UICtrlMsg.BuygoldUI_Open);
}
});
}
else
{
TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, LevelData[index].Name, null, "LevelAlbums/", FolderNames.AlbumName);
item.btn_download.SetClick(() =>
{
if (GameHelper.GetVipPrivilege(Subscription.FreeDownImage.As<int>()))
{
TextureHelper.SaveImageToAlbum(LevelData[index].Name, FolderNames.AlbumName);
}
else
{
GameHelper.ShowVideoAd("DownloadImage", isSuccess =>
{
if (isSuccess)
{
TextureHelper.SaveImageToAlbum(LevelData[index].Name, FolderNames.AlbumName);
}
});
}
});
btn_down_coin.SetClick(() =>
{
if (GameHelper.Get101() >= downloadCoinNum)
{
GameHelper.AddGold(-downloadCoinNum);
TextureHelper.SaveImageToAlbum(LevelData[index].Name, FolderNames.AlbumName);
TrackKit.SendEvent(ADEventTrack.Coinsbuy, ADEventTrack.Property.download);
}
else
{
GameHelper.ShowTips("no_enough_gold", true);
uiCtrlDispatcher.Dispatch(UICtrlMsg.BuygoldUI_Open);
}
});
}
}
}
}
}
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 6254fab7306ab4f54b9ddc37e9f9c554
guid: 47ef18a651dc245c587515925adba37d
MonoImporter:
externalObjects: {}
serializedVersion: 2
@@ -1,17 +1,19 @@
namespace FlowerPower
{
public class LoginloadingUICtrl : BaseUICtrl
{
private LoginloadingUI ui;
private LoginloadingModel model;
private uint openUIMsg = UICtrlMsg.LoginloadingUI_Open;
private uint closeUIMsg = UICtrlMsg.LoginloadingUI_Close;
namespace LoveLegend
{
public class AlbumDetailUICtrl : BaseUICtrl
{
private AlbumDetailUI ui;
private AlbumDetailModel model;
private uint openUIMsg = UICtrlMsg.AlbumDetailUI_Open;
private uint closeUIMsg = UICtrlMsg.AlbumDetailUI_Close;
#region
protected override void OnInit()
{
//model = ModuleManager.Instance.GetModel(ModelConst.LoginloadingModel) as LoginloadingModel;
//model = ModuleManager.Instance.GetModel(ModelConst.AlbumDetailModel) as AlbumDetailModel;
}
protected override void OnDispose()
@@ -22,7 +24,7 @@ namespace FlowerPower
{
if (ui == null)
{
ui = new LoginloadingUI(this);
ui = new AlbumDetailUI(this);
ui.Open(args);
}
}
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 95a4ab1450a704a8a86208f20b15f859
guid: a0ae060ce359f4428b4c82fd96f6f2c0
MonoImporter:
externalObjects: {}
serializedVersion: 2
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: c818683ad0008c741a3155715904df35
guid: 835af6bef1d644831a65b4e33ba7fa24
folderAsset: yes
DefaultImporter:
externalObjects: {}
@@ -0,0 +1,25 @@
namespace LoveLegend
{
public class AlubumCtrl : BaseCtrl
{
public static AlubumCtrl Instance { get; private set; }
private AlubumModel model;
#region
protected override void OnInit()
{
Instance = this;
//model = ModuleManager.Instance..GetModel(ModelConst.AlubumModel) as AlubumModel;
}
protected override void OnDispose()
{
Instance = null;
}
#endregion
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: afb7ba0a285a24cf6a2b59cbad176778
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,8 +1,8 @@
namespace FlowerPower
namespace LoveLegend
{
public class AddViewoffModel : BaseModel
public class AlubumModel : BaseModel
{
#region
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a84f029a2173e4a74b9b57cdd492a693
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+494
View File
@@ -0,0 +1,494 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using DG.Tweening;
using FairyGUI;
using FGUI.LG_albums;
using UnityEngine;
using System;
using System.Threading;
using System.Threading.Tasks;
namespace LoveLegend
{
public class AlubumUI : BaseUI
{
private AlubumUICtrl ctrl;
private AlubumModel model;
private com_albums ui;
private long[] UpDatatime;
public AlubumUI(AlubumUICtrl ctrl) : base(ctrl)
{
uiName = UIConst.AlubumUI;
this.ctrl = ctrl;
}
protected override void SetUIInfo(UIInfo uiInfo)
{
uiInfo.packageName = "LG_albums";
uiInfo.assetName = "com_albums";
uiInfo.layerType = UILayerType.Popup;
uiInfo.isNeedOpenAnim = false;
uiInfo.isNeedCloseAnim = false;
uiInfo.isNeedUIMask = true;
}
//初始化页面逻辑
private void InitView(object a = null)
{
UpDatatime = new long[LevelData.Count];
ImageName = new string[LevelData.Count];
ui.list_albums.itemRenderer = RendererList;
ui.list_albums.numItems = LevelData.Count;
InitScroll();
}
private void SetItemData(object obj = null)
{
UpDatatime[(int)obj] = 0;
ui.list_albums.RefreshVirtualList();
}
#region
protected override void OnInit()
{
GLoaderPool.Instance.Init(null, 24, 312, 310);
}
protected override void OnClose()
{
foreach (var t in loader_list)
if (t != null && !t.isDisposed && t.texture != null)
{
t.texture.Dispose();
t.texture = null;
}
// 1. 解除 UI 对 Loader 的引用
for (var i = 0; i < ui.list_albums.numChildren; i++)
{
var item = ui.list_albums.GetChildAt(i) as item_albums;
if (item != null && item.com_loader.loader != null) item.com_loader.loader = null; // 清掉 GLoader 引用
}
activeLoaders.Clear();
_fileIsExist.Clear();
GLoaderPool.Instance.DisposeAll();
TextureHelper.ClearMaterialPool();
// 强制卸载未使用的资源
Resources.UnloadUnusedAssets();
MemoryManager.CleanMemoryMonitor();
}
protected override void OnBind()
{
ui = baseUI as com_albums;
}
private List<LevelUnlock> LevelData;
private readonly List<GLoader> loader_list = new();
public SmartInvoker invoker;
protected override void OnOpenBefore(object args)
{
invoker = new SmartInvoker(() =>
{
for (int i = 0; i < UpDatatime.Length; i++)
{
UpDatatime[i] = 0;
// ImageName[i] = "";
}
ui.list_albums.RefreshVirtualList();
}, TimeSpan.FromSeconds(0.2f));
LevelData = ConfigSystem.GetConfig<LevelUnlock>();
ui.list_albums.SetVirtual();
ui.btn_close1.SetClick(() => { CtrlCloseUI(); });
InitView();
}
private const int MaxVisibleCount = 18; // 一屏显示18个
private const int PreloadCount = 3; // 上下各预加载一屏
private readonly Dictionary<int, GLoader> activeLoaders = new();
private readonly Dictionary<int, bool> _fileIsExist = new();
private Throttle _throttle;
private void InitScroll()
{
// ui.list_albums.scrollPane.onScroll.Add(OnScrollUpdate);
ui.list_albums.scrollPane.onScrollEnd.Add(OnScrollEndCB); // 保留结束时的整理
OnScrollEnd();
}
private void OnScrollEndCB()
{
// UpdateVisibleAndPreload();
OnScrollEnd();
// Debug.Log("更新一次");
}
private void UpdateVisibleAndPreload()
{
// Debug.Log("[UpdateVisibleAndPreload]--------111111--------- ");
// if (LevelData == null || LevelData.Count == 0) return;
// var firstVisibleIndex = ui.list_albums.GetFirstChildInView();
// var lastVisibleIndex = Mathf.Min(firstVisibleIndex + MaxVisibleCount - 1, ui.list_albums.numItems - 1);
// var startIndex = Mathf.Max(0, firstVisibleIndex - PreloadCount);
// var endIndex = Mathf.Min(ui.list_albums.numItems - 1, lastVisibleIndex + PreloadCount);
// // 回收超出范围 loader
// var keysToRemove = new List<int>();
// foreach (var kv in activeLoaders)
// {
// var idx = kv.Key;
// if (idx < startIndex || idx > endIndex)
// {
// GLoaderPool.Instance.ReturnLoader(kv.Value);
// var oldItem = ui.list_albums.GetChildAt(idx) as item_albums;
// if (oldItem != null) oldItem.com_loader.loader = null;
// keysToRemove.Add(idx);
// }
// }
// foreach (var k in keysToRemove) activeLoaders.Remove(k);
// // 分配 loader 并加载图片
// for (var i = startIndex; i <= endIndex; i++)
// {
// if (activeLoaders.ContainsKey(i)) continue;
// var item = ui.list_albums.GetChildAt(i) as item_albums;
// if (item == null) continue;
// if (item.com_loader.loader != null && !item.com_loader.loader.isDisposed)
// GLoaderPool.Instance.ReturnLoader(item.com_loader.loader);
// var loader = GLoaderPool.Instance.GetLoader();
// item.com_loader.loader = loader;
// item.com_loader.AddChild(loader);
// loader.SetSize(item.com_loader.loader.width, item.com_loader.loader.height);
// _fileIsExist.TryGetValue(i, out var value);
// if (!value)
// {
// var localPath = Path.Combine(TextureHelper.getResPath(), LevelData[i].Name + ".jpg");
// if (File.Exists(localPath))
// {
// _fileIsExist[i] = true;
// Debug.Log($"[SetImgLoader] 本地存在,直接加载 {LevelData[i].Name}");
// CrazyAsyKit.StartCoroutine(TextureHelper.LoadTexture(LevelData[i].Name, loader, null,
// "LevelAlbums/"));
// }
// else
// {
// _fileIsExist[i] = false;
// }
// }
// else
// {
// CrazyAsyKit.StartCoroutine(TextureHelper.LoadTexture(LevelData[i].Name, loader, null,
// "LevelAlbums/"));
// }
// activeLoaders[i] = loader;
// }
// Debug.Log($"[ScrollUpdate] active loaders={activeLoaders.Count}, pool={GLoaderPool.Instance.GetPoolCount()}, inUse={GLoaderPool.Instance.GetInUseCount()}");
}
private void OnScrollEnd()
{
invoker.Invoke();
// for (int i = 0; i < UpDatatime.Length; i++)
// {
// UpDatatime[i] = 0;
// // ImageName[i] = "";
// }
// DOVirtual.DelayedCall(0.1f, () =>
// {
// ui.list_albums.RefreshVirtualList();
// });
// if (LevelData == null || LevelData.Count == 0) return;
// var firstVisibleIndex = ui.list_albums.GetFirstChildInView();
// var lastVisibleIndex = Mathf.Min(firstVisibleIndex + MaxVisibleCount - 1, ui.list_albums.numItems - 1);
// var startIndex = Mathf.Max(0, firstVisibleIndex - PreloadCount);
// var endIndex = Mathf.Min(ui.list_albums.numItems - 1, lastVisibleIndex + PreloadCount);
// // Debug.Log($"[ScrollEnd] start index={startIndex} end index={endIndex}");
// var tasks = new List<(GLoader loader, string fileName, Action<NTexture> callback, string folder)>();
// // 分配 loader 并加载图片
// for (var i = startIndex; i <= endIndex; i++)
// {
// _fileIsExist.TryGetValue(i, out var value);
// if (value) continue;
// if (GameHelper.GetLevel() < i + 1) continue;
// var item = ui.list_albums.GetChildAt(i) as item_albums;
// if (item == null) continue;
// if (item.com_loader.loader != null && !item.com_loader.loader.isDisposed)
// GLoaderPool.Instance.ReturnLoader(item.com_loader.loader);
// var loader = GLoaderPool.Instance.GetLoader();
// item.com_loader.loader = loader;
// item.com_loader.AddChild(loader);
// loader.SetSize(item.com_loader.loader.width, item.com_loader.loader.height);
// var idx = i;
// tasks.Add((loader, LevelData[i].Name, NTexture =>
// {
// if (NTexture != null) _fileIsExist[idx] = true;
// }, "LevelAlbums/"));
// activeLoaders[i] = loader;
// }
// if (tasks.Count > 0) TextureHelper.SetImgLoaders(tasks);
}
private string[] ImageName;
private void RendererList(int index, GObject obj)
{
// Debug.Log("Render list" );
// Debug.Log(JsonConvert.SerializeObject(LevelData[index]));
item_albums item = (item_albums)obj;
item.text_num.text = (index + 1).ToString();
if (index < GameHelper.GetCommonModel().MultiModal - 1)
{
item.type_.selectedIndex = 0;
if (GameHelper.GetLevel() > index + 1)
{
item.SetClick(() => { uiCtrlDispatcher.Dispatch(UICtrlMsg.AlbumDetailUI_Open, index); });
}
else
{
item.SetClick(() => { GameHelper.ShowTips("lv_unlock", true); });
}
}
else
{
Levelunlock levelunlock_ = DataMgr.LevelUnlockListNew.Value.FirstOrDefault(x => x.level_ == index + 1);
if (levelunlock_ != null)
{
item.type_.selectedIndex = levelunlock_.type;
}
else item.type_.selectedIndex = 0;
if (GameHelper.GetLevel() > index + 1)
{
item.SetClick(() => { uiCtrlDispatcher.Dispatch(UICtrlMsg.AlbumDetailUI_Open, index); });
}
else
{
item.SetClick(() => { GameHelper.ShowTips("lv_unlock", true); });
}
}
if (GameHelper.GetNowTime() < UpDatatime[index] + 1) return;
UpDatatime[index] = GameHelper.GetNowTime();
// if (!activeLoaders.ContainsValue(item.com_loader.loader)) activeLoaders[index] = item.com_loader.loader;
if (!loader_list.Contains(item.com_loader.GetChild("loader") as GLoader))
loader_list.Add(item.com_loader.GetChild("loader") as GLoader);
if (index < GameHelper.GetCommonModel().MultiModal - 1)
{
if (GameHelper.GetLevel() > index + 1)
{
item.isUnlock.selectedIndex = 1;
if (item.com_loader.loader.texture == null ||
item.com_loader.loader.texture.nativeTexture.name != LevelData[index].Name)
{
// item.isUnlock.selectedIndex = 0;
// if (item.com_loader.loader.texture != null)
// {
// item.com_loader.loader.texture.Dispose(); // 释放 GPU 资源
// item.com_loader.loader.texture = null; // 断开引用
// }
TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, LevelData[index].Name,
(a) => { Debug.Log(item.com_loader.loader.texture.nativeTexture.name); }, "LevelAlbums/", FolderNames.AlbumName);
ImageName[index] = LevelData[index].Name;
}
item.touchable = true;
}
else
{
item.isUnlock.selectedIndex = 0;
// item.touchable = false;
}
}
else
{
Levelunlock levelunlock_ = DataMgr.LevelUnlockListNew.Value.FirstOrDefault(x => x.level_ == index + 1);
if (GameHelper.GetLevel() > index + 1)
{
if (levelunlock_ != null)
{
item.isUnlock.selectedIndex = 1;
if (item.com_loader.loader.texture == null || item.com_loader.loader.texture.nativeTexture.name != ImageName[index])
{
if (levelunlock_.type == 0)
{
if (levelunlock_.config_index >= ConfigSystem.GetConfig<FreeImageLibrary>().Count) levelunlock_.config_index = ConfigSystem.GetConfig<FreeImageLibrary>().Count - 1;
FreeImageLibrary _leveldata = ConfigSystem.GetConfig<FreeImageLibrary>()[levelunlock_.config_index];
TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, _leveldata.Name, null, "LevelAlbums/", FolderNames.AlbumName);
ImageName[index] = LevelData[index].Name;
}
else if (levelunlock_.type == 1)
{
if (levelunlock_.config_index >= ConfigSystem.GetConfig<ADImageLibrary>().Count) levelunlock_.config_index = ConfigSystem.GetConfig<ADImageLibrary>().Count - 1;
ADImageLibrary _leveldata = ConfigSystem.GetConfig<ADImageLibrary>()[levelunlock_.config_index];
TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, _leveldata.Name, null, "LevelAlbums/", FolderNames.AlbumName);
ImageName[index] = LevelData[index].Name;
}
else if (levelunlock_.type == 2)
{
if (levelunlock_.config_index >= ConfigSystem.GetConfig<SpecialImageLibrary>().Count) levelunlock_.config_index = ConfigSystem.GetConfig<SpecialImageLibrary>().Count - 1;
SpecialImageLibrary _leveldata = ConfigSystem.GetConfig<SpecialImageLibrary>()[levelunlock_.config_index];
TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, _leveldata.Name, null, "LevelAlbums/", FolderNames.AlbumName);
ImageName[index] = LevelData[index].Name;
}
else if (levelunlock_.type == 3)
{
if (levelunlock_.config_index >= ConfigSystem.GetConfig<VIPImageLibrary>().Count) levelunlock_.config_index = ConfigSystem.GetConfig<VIPImageLibrary>().Count - 1;
VIPImageLibrary _leveldata = ConfigSystem.GetConfig<VIPImageLibrary>()[levelunlock_.config_index];
TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, _leveldata.Name, null, "LevelAlbums/", FolderNames.AlbumName);
ImageName[index] = LevelData[index].Name;
}
}
}
else
{
item.isUnlock.selectedIndex = 1;
if (item.com_loader.loader.texture == null || item.com_loader.loader.texture.nativeTexture.name != LevelData[index].Name)
{
TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, LevelData[index].Name, null, "LevelAlbums/", FolderNames.AlbumName);
ImageName[index] = LevelData[index].Name;
}
}
}
else
{
// item.touchable = false;
item.isUnlock.selectedIndex = 0;
}
}
}
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.UnlockAlbums, SetItemData);
}
protected override void RemoveListener()
{
GameDispatcher.Instance.RemoveListener(GameMsg.UnlockAlbums, SetItemData);
}
#endregion
}
public class SmartInvoker
{
private readonly Action _action;
private readonly TimeSpan _delay;
private DateTime _lastImmediateInvoke = DateTime.MinValue;
private CancellationTokenSource _cts = null;
private readonly object _lock = new object();
private bool _hasPending = false;
public SmartInvoker(Action action, TimeSpan delay)
{
_action = action;
_delay = delay;
}
public void Invoke()
{
lock (_lock)
{
var now = DateTime.UtcNow;
var timeSinceLast = now - _lastImmediateInvoke;
if (timeSinceLast >= _delay)
{
_lastImmediateInvoke = now;
_action();
Debug.Log("diaoyongyiciiiiiiiiiiiiiii");
}
else
{
_hasPending = true;
_cts?.Cancel();
_cts = new CancellationTokenSource();
var token = _cts.Token;
Task.Delay(_delay, token).ContinueWith(t =>
{
if (!t.IsCanceled)
{
lock (_lock)
{
if (_hasPending)
{
_lastImmediateInvoke = DateTime.UtcNow;
_hasPending = false;
_action();
Debug.Log("diaoyongyiciiiiiiiiiiiiiii");
}
}
}
}, TaskScheduler.Default);
}
}
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 8211638a3a24a4f0f9e093343198e8ef
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,19 +1,19 @@
namespace FlowerPower
namespace LoveLegend
{
public class AddViewoffUICtrl : BaseUICtrl
public class AlubumUICtrl : BaseUICtrl
{
private AddViewoffUI ui;
private AddViewoffModel model;
private AlubumUI ui;
private AlubumModel model;
private uint openUIMsg = UICtrlMsg.AddViewoffUI_Open;
private uint closeUIMsg = UICtrlMsg.AddViewoffUI_Close;
private uint openUIMsg = UICtrlMsg.AlubumUI_Open;
private uint closeUIMsg = UICtrlMsg.AlubumUI_Close;
#region
protected override void OnInit()
{
//model = ModuleManager.Instance.GetModel(ModelConst.AddViewoffModel) as AddViewoffModel;
//model = ModuleManager.Instance.GetModel(ModelConst.AlubumModel) as AlubumModel;
}
protected override void OnDispose()
@@ -24,7 +24,7 @@ namespace FlowerPower
{
if (ui == null)
{
ui = new AddViewoffUI(this);
ui = new AlubumUI(this);
ui.Open(args);
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a1c15e9bbddc64e5ca24ec7c564207a5
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+1 -1
View File
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 1b5a9ea3a6ed94acea0ffb49d590cccb
guid: 372fb7ce72e687245966c9031b91edc6
folderAsset: yes
DefaultImporter:
externalObjects: {}
@@ -1,8 +1,4 @@
using System.Collections;
using System.Collections.Generic;
namespace FlowerPower
namespace LoveLegend
{
public class BroadcastCtrl : BaseCtrl
{
@@ -1,4 +1,4 @@
namespace FlowerPower
namespace LoveLegend
{
public class BroadcastModel : BaseModel
{
@@ -1,22 +1,18 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using FutureCore;
using FairyGUI;
using System;
using System.Collections.Generic;
using DG.Tweening;
using FGUI.ZM_Common_01;
using Spine.Unity;
using FlowerPower;
using FGUI.P01_Common;
using UnityEngine;
using Random = UnityEngine.Random;
namespace FlowerPower
namespace LoveLegend
{
public class BroadcastUI : BaseUI
{
private BroadcastUICtrl ctrl;
private BroadcastModel model;
private FGUI.P01_Common.com_broadcast1 ui;
private com_broadcast1 ui;
public BroadcastUI(BroadcastUICtrl ctrl) : base(ctrl)
{
@@ -26,9 +22,9 @@ namespace FlowerPower
protected override void SetUIInfo(UIInfo uiInfo)
{
uiInfo.packageName = "P01_Common";
uiInfo.packageName = "ZM_Common_01";
uiInfo.assetName = "com_broadcast1";
uiInfo.layerType = UILayerType.Top;
uiInfo.layerType = UILayerType.Highest;
uiInfo.isNeedOpenAnim = false;
uiInfo.isNeedCloseAnim = false;
uiInfo.isNeedUIMask = false;
@@ -42,12 +38,11 @@ namespace FlowerPower
protected override void OnClose()
{
HallManager.Instance.UpdateSecondEvent -= timeEvent;
}
protected override void OnBind()
{
ui = baseUI as FGUI.P01_Common.com_broadcast1;
ui = baseUI as com_broadcast1;
}
protected override void OnOpenBefore(object args)
@@ -57,11 +52,13 @@ namespace FlowerPower
if (UIManager.Instance.IsExistUI(UIConst.RainPlayUI))
{
Setbuttom();
Settop();
}
else
{
Settop();
Setbuttom();
}
// ui.visible = false;
// if (Screen.safeArea.y != 0)
@@ -70,16 +67,17 @@ namespace FlowerPower
// }
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;
text_ui.btn_broad.SetClick(OpenRecord);
if (ConfigSystem.GetConfig<SubscribePodcast>() == null) return;
config_name_list = SubscribePodcastModel.config_name_list;
config_vip_level_list = SubscribePodcastModel.config_vip_level_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);
UICtrlDispatcher.Instance.AddListener(UICtrlMsg.MainUI_Open, Setbuttom);
UICtrlDispatcher.Instance.AddListener(UICtrlMsg.RainPlayUI_Open, Settop);
}
protected override void OnOpen(object args)
@@ -108,11 +106,11 @@ namespace FlowerPower
private int time_count = 11;
private com_broadcast_text1 text_ui;
private List<string> config_name_list;
private List<string> config_money_list;
private List<string> config_vip_level_list;
private bool main_ui_show = true;
//初始化页面逻辑
private Action closeCallback = null;
private Action closeCallback;
private void InitView()
{
HallManager.Instance.UpdateSecondEvent += timeEvent;
@@ -120,6 +118,7 @@ namespace FlowerPower
var sk = FXManager.Instance.SetFx<SkeletonAnimation>(ui.broad_cast_text.bg_panel, Fx_Type.fx_broad, ref closeCallback);
sk.state.SetAnimation(0, "animation", true);
ui.broad_cast_text.bg_panel.SetScale(1.45f, 1.1f);
}
private void OpenRecord()
@@ -140,79 +139,83 @@ namespace FlowerPower
}
private void Settop(object sender = null)
{
ui.group_.y = 578;
// if (Screen.safeArea.y != 0)
// {//刘海屏
// ui.group_.y += Screen.safeArea.y;
// }
ui.group_.y = 350;
if (Screen.safeArea.y != 0)
{//刘海屏
ui.group_.y += 68;
}
}
private void Setbuttom(object sender = null)
{
//ui.group_.y = GRoot.inst.height - 300;
ui.group_.y = 431;
ui.group_.y = 170;
if (Screen.safeArea.y != 0)
{//刘海屏
ui.group_.y += Screen.safeArea.y;
ui.group_.y += 68;
}
}
# if GAME_RELEASE
private const int MaxTime = 300;
#else
private const int MaxTime = 10;
#endif
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)
Debug.Log(time_count);
Debug.Log(MaxTime);
if (time_count > MaxTime)
{
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);
var name_index = Random.Range(0, config_name_list.Count);
var money_index = Random.Range(0, config_vip_level_list.Count);
Debug.Log(text_ui.cast_text.text);
string name = config_name_list[name_index];
if (name.Length > 4)
if (name.Length > 8)
{
name = name[..4] + "...";
name = name[..8] + "..";
}
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());
config_vip_level_list[money_index], DateTimeManager.Instance.GetCurrDateTime());
text_ui.cast_text.text = broad_text;
var lv = GetVipLevelFromName(config_vip_level_list[money_index]);
text_ui.broad_icon_loader.url = $"ui://LG_Common/vip_{lv}";
// Tweener tweener = DOTween.To(() => ui.broad.x,
// x => ui.broad.x = x, 200, 0.5f);
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();
string str = name + "#" + config_vip_level_list[money_index] + "#" + DateTimeManager.Instance.GetCurrDateTime();
GameDispatcher.Instance.Dispatch(GameMsg.updateRecordList, str);
}
}
private int GetVipLevelFromName(string name)
{
var vip_level = 1;
switch (name)
{
case "Gold":
vip_level = 1;
break;
case "Platinum":
vip_level = 2;
break;
case "Diamond":
vip_level = 3;
break;
}
return vip_level;
}
}
}
}
@@ -1,8 +1,4 @@
using System.Collections;
using System.Collections.Generic;
namespace FlowerPower
namespace LoveLegend
{
public class BroadcastUICtrl : BaseUICtrl
@@ -71,7 +67,6 @@ namespace FlowerPower
{
}
#endregion
}
}
@@ -1,19 +0,0 @@
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;
}
}
}
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 7dbfdda822c575a4781a16e0d287bba7
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 5b29a35cdab494a41af5a4c88555751c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,111 +0,0 @@
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()
{
}
}
}
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 03ed3e3011c9ac649a6e6854de3334fd
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,60 +0,0 @@
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);
}
}
}
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: da3cdb5285c9e874096d91d9824f1e6e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,4 +1,4 @@
namespace FlowerPower
namespace LoveLegend
{
public class BuyPropCtrl : BaseCtrl
{
@@ -1,4 +1,4 @@
namespace FlowerPower
namespace LoveLegend
{
public class BuyPropModel : BaseModel
{
+48 -60
View File
@@ -1,13 +1,10 @@
using System;
using FGUI.P01_Common;
namespace FlowerPower
namespace LoveLegend
{
public class BuyPropUI : BaseUI
{
private BuyPropUICtrl ctrl;
private BuyPropModel model;
private FGUI.P09_ChooseProp.com_prop ui;
private FGUI.ZM_Prop_09.com_prop ui;
private int state_ = 0;
public BuyPropUI(BuyPropUICtrl ctrl) : base(ctrl)
@@ -15,17 +12,15 @@ namespace FlowerPower
uiName = UIConst.BuyPropUI;
this.ctrl = ctrl;
}
private btn_watchAd btn_watchAd;
protected override void SetUIInfo(UIInfo uiInfo)
{
uiInfo.packageName = "P09_ChooseProp";
uiInfo.packageName = "ZM_Prop_09";
uiInfo.assetName = "com_prop";
uiInfo.layerType = UILayerType.Popup;
uiInfo.isNeedOpenAnim = false;
uiInfo.isNeedCloseAnim = false;
uiInfo.isNeedUIMask = true;
uiInfo.isNeedUIMask = false;
}
#region
@@ -37,40 +32,23 @@ namespace FlowerPower
protected override void OnClose()
{
GameHelper.showGameUI = true;
HallManager.Instance.UpdateSecondEvent -= SetWatchBtnCd;
}
protected override void OnBind()
{
ui = baseUI as FGUI.P09_ChooseProp.com_prop;
ui = baseUI as FGUI.ZM_Prop_09.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.GetChild("text_gold").text = GameHelper.Get101Str(ConfigSystem.GetCommonConf().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();
}
});
});
setBtnState(state_);
InitView();
HallManager.Instance.UpdateSecondEvent += SetWatchBtnCd;
SetWatchBtnCd();
}
void buyItem()
{
@@ -88,42 +66,23 @@ namespace FlowerPower
}
if (GameHelper.CheckGoldNumber(ConfigSystem.GetConfig<CommonModel>().Purchaseprops))
if (GameHelper.CheckGoldNumber(ConfigSystem.GetCommonConf().Purchaseprops))
{
BuyPropSuccess();
GameHelper.AddGoldNumber(-ConfigSystem.GetCommonConf().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("purchase_succ", true);
CtrlCloseUI();
}
else
{
GameHelper.ShowTips("Not enough gold");
GameHelper.ShowTips("no_enough_gold", true);
}
}
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)
@@ -158,6 +117,35 @@ namespace FlowerPower
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.SheepwindowUI_Close);
});
// ui.btn_buy0.SetClick(() =>
// {
// state_ = 0;
// ui.prop.selectedIndex = 0;
// setBtnState(0);
// });
// ui.btn_buy1.SetClick(() =>
// {
// state_ = 1;
// ui.prop.selectedIndex = 1;
// setBtnState(1);
// });
// ui.btn_buy2.SetClick(() =>
// {
// state_ = 2;
// ui.prop.selectedIndex = 2;
// setBtnState(2);
// });
}
private void setBtnState(int index)
{
// ui.btn_buy0.tab_choose.selectedIndex = index == 0 ? 1 : 0;
// ui.btn_buy1.tab_choose.selectedIndex = index == 1 ? 1 : 0;
// ui.btn_buy2.tab_choose.selectedIndex = index == 2 ? 1 : 0;
}
}
}
}
@@ -1,4 +1,4 @@
namespace FlowerPower
namespace LoveLegend
{
public class BuyPropUICtrl : BaseUICtrl
{
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: c003c40f534c48c4eb6cab621e82134d
guid: 6c531c42d4fca4ff7b2785c66a8f93e9
folderAsset: yes
DefaultImporter:
externalObjects: {}
@@ -1,18 +1,18 @@
namespace FlowerPower
namespace LoveLegend
{
public class FAQCtrl : BaseCtrl
public class ChatCtrl : BaseCtrl
{
public static FAQCtrl Instance { get; private set; }
public static ChatCtrl Instance { get; private set; }
private FAQModel model;
private ChatModel model;
#region
protected override void OnInit()
{
Instance = this;
//model = ModuleManager.Instance..GetModel(ModelConst.FAQModel) as FAQModel;
//model = ModuleManager.Instance..GetModel(ModelConst.ChatModel) as ChatModel;
}
protected override void OnDispose()
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 4f85819b166c34048b8b0e9ca525fe8e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,8 +1,8 @@
namespace FlowerPower
namespace LoveLegend
{
public class FAQModel : BaseModel
public class ChatModel : BaseModel
{
#region
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: f469f84c20ba64b5994e844b29a7f2fe
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+352
View File
@@ -0,0 +1,352 @@
using FGUI.ZM_Common_01;
using UnityEngine;
using FairyGUI;
using IgnoreOPS;
using Newtonsoft.Json;
using System.Linq;
using FGUI.LG_AIchat;
using DG.Tweening;
using System.Collections.Generic;
using System;
using System.Linq.Expressions;
namespace LoveLegend
{
public class ChatUI : BaseUI
{
private ChatUICtrl ctrl;
private ChatModel model;
private FGUI.LG_AIchat.com_chat ui;
public ChatUI(ChatUICtrl ctrl) : base(ctrl)
{
uiName = UIConst.ChatUI;
this.ctrl = ctrl;
}
protected override void SetUIInfo(UIInfo uiInfo)
{
uiInfo.packageName = "LG_AIchat";
uiInfo.assetName = "com_chat";
uiInfo.layerType = UILayerType.Popup;
uiInfo.isNeedOpenAnim = false;
uiInfo.isNeedCloseAnim = false;
uiInfo.isNeedUIMask = true;
}
#region
protected override void OnInit()
{
//model = ModuleManager.Instance.GetModel(ModelConst.ChatModel) as ChatModel;
}
protected override void OnClose()
{
ChatHelper.chat_red_list[chat_index] = false;
GameDispatcher.Instance.Dispatch(GameMsg.RefreshRedDot);
UnityManager.ShezhiACT(true);
}
protected override void OnBind()
{
ui = baseUI as FGUI.LG_AIchat.com_chat;
}
protected override void OnOpenBefore(object args)
{
// ChatHelper.GetMessage(1);
// ChatHelper.ResetMessage(1);
if (args != null) chat_index = (int)args;
if (DataMgr.ChatData.Value == null)
{
DataMgr.ChatData.Value = new List<ChatItem>();
}
if (Screen.safeArea.y != 0)
{
ui.group_.y += Screen.safeArea.y - 15;
}
Debug.Log(JsonConvert.SerializeObject(DataMgr.ChatData.Value));
ui.btn_close.SetClick(CtrlCloseUI);
ui.type.selectedIndex = ui.btn_tophead.type.selectedIndex = chat_index;
InitView();
ui.btn_photo.SetClick(() =>
{
GameHelper.ShowTips("launching_soon", true);
});
ui.btn_video.SetClick(() =>
{
GameHelper.ShowTips("launching_soon", true);
});
UnityManager.ShezhiACT(false);
}
public static bool IsSameDay(long timestamp)
{
// 假设时间戳是 Unix 时间戳(秒),如果是毫秒记得除以 1000
DateTime inputTime = DateTimeOffset.FromUnixTimeSeconds(timestamp).DateTime;
DateTime now = DateTimeOffset.FromUnixTimeSeconds(GameHelper.GetNowTime()).DateTime;
// 比较年月日是否一致
return inputTime.Date == now.Date;
}
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.LiveChange, addNewItem);
GameDispatcher.Instance.AddListener(GameMsg.AddChatNum, setChatNum);
GameDispatcher.Instance.AddListener(GameMsg.Gold_refresh, SetTopCurr);
}
protected override void RemoveListener()
{
GameDispatcher.Instance.RemoveListener(GameMsg.LiveChange, addNewItem);
GameDispatcher.Instance.RemoveListener(GameMsg.AddChatNum, setChatNum);
GameDispatcher.Instance.RemoveListener(GameMsg.Gold_refresh, SetTopCurr);
}
public void SetTopCurr(object a = null)
{
Debug.Log("??????????");
var btn_gold = ui.btn_gold as com_gold;
btn_gold.text_gold.text = $"{DataMgr.Coin.Value:N0}";
}
private void addNewItem(object a = null)
{
_ChatItem = DataMgr.ChatData.Value.FirstOrDefault(c => c.role == ChatType.GetType(chat_index));
if (_ChatItem.content_list.Count > list_count)
{
if (have_inputani && ChatHelper.unshow_message[chat_index] <= 0)
{
ui.list_.RemoveChildAt(list_count);
have_inputani = false;
}
// else if (have_inputani && ChatHelper.unshow_message[chat_index] > 0)
// {
// }
for (int i = list_count; i < _ChatItem.content_list.Count; i++)
{
if (_ChatItem.content_list[i].type == 1)
{
item_chatText_left com_msg = (item_chatText_left)UIPackage.CreateObject("LG_AIchat", "item_chatText_left");
com_msg.text_content.text = _ChatItem.content_list[i].text_content;
// if (chat_index == 0) com_msg.head.url = "ui://tksc66j2ljeg27";
// else if (chat_index == 1) com_msg.head.url = "ui://tksc66j2ljeg25";
// else if (chat_index == 2) com_msg.head.url = "ui://tksc66j2ljeg20";
com_msg.type.selectedIndex = chat_index;
if (ChatHelper.unshow_message[chat_index] <= 0 || (!have_inputani)) ui.list_.AddChild(com_msg);
else ui.list_.AddChildAt(com_msg, ui.list_.numChildren - 1);
}
}
// if (ChatHelper.unshow_message[chat_index] > 0)
// {
// item_chatText_left com_msg_ = (item_chatText_left)UIPackage.CreateObject("LG_AIchat", "item_chatText_left");
// com_msg_.t0.Play(-1, 0, null);
// if (chat_index == 0) com_msg_.head.url = "ui://tksc66j2ljeg27";
// else if (chat_index == 1) com_msg_.head.url = "ui://tksc66j2ljeg25";
// else if (chat_index == 2) com_msg_.head.url = "ui://tksc66j2ljeg20";
// ui.list_.AddChild(com_msg_);
// have_inputani = true;
// }
list_count = _ChatItem.content_list.Count;
ui.list_.ScrollToView(list_count - 1);
}
}
private void setChatNum(object a = null)
{
if (DataMgr.ChatFreeNumber.Value == 0 && DataMgr.ChatNumber.Value == 0)
{
// ui.have_free.selectedIndex = 1;
// ui.text_remainfreeNum.text = "Free:" + DataMgr.ChatFreeNumber.Value;
// ui.btn_send.state.selectedIndex = 0;
ui.btn_send.title = Language.GetContent("get_more");
}
else
{
// ui.have_free.selectedIndex = 0;
// ui.text_remainNum.text = ":" + DataMgr.ChatNumber.Value;
// ui.btn_send.state.selectedIndex = 1;
ui.btn_send.title = Language.GetContent("Send");
}
if (DataMgr.ChatFreeNumber.Value > 0)
{
ui.btn_send.text_remainNum.text = Language.GetContentParams("Free_1", DataMgr.ChatFreeNumber.Value);
}
else
{
ui.btn_send.text_remainNum.text = DataMgr.ChatNumber.Value.ToString();
}
// if (DataMgr.ChatFreeNumber.Value <= 0 && DataMgr.ChatNumber.Value <= 0) ui.btn_send.title = "Get More";
// else ui.btn_send.title = "Send";
}
#endregion
private ChatItem _ChatItem;
private int chat_index = 2;
private int list_count = 0;
//初始化页面逻辑
private void InitView()
{
Debug.Log(DataMgr.ChatData.Value);
SetTopCurr();
_ChatItem = DataMgr.ChatData.Value.FirstOrDefault(c => c.role == ChatType.GetType(chat_index));
Debug.Log(JsonConvert.SerializeObject(_ChatItem));
if (DataMgr.ChatRecoverDays.Value != DateTime.Now.Day)
{
DataMgr.ChatFreeNumber.Value = GameHelper.GetCommonModel().FreeMessages;
DataMgr.ChatRecoverDays.Value = DateTime.Now.Day;
}
setChatNum();
if (_ChatItem != null)
{
_ChatItem.content_list.RemoveAll(item => !IsSameDay(item.chat_time));
if (_ChatItem.content_list.Count > 100)
{
_ChatItem.content_list.RemoveRange(0, _ChatItem.content_list.Count - 100);
}
DataMgr.ChatData.Save();
list_count = _ChatItem.content_list.Count;
Debug.Log(list_count + "..................");
for (int i = 0; i < _ChatItem.content_list.Count; i++)
{
if (_ChatItem.content_list[i].type == 0)
{
item_chatText_right com_msg = (item_chatText_right)UIPackage.CreateObject("LG_AIchat", "item_chatText_right");
com_msg.text_content.text = _ChatItem.content_list[i].text_content;
GameHelper.SetSelfAvatar(com_msg.btn_head.load_avatar, DataMgr.PlayerAvatarId.Value);
ui.list_.AddChild(com_msg);
}
else
{
item_chatText_left com_msg = (item_chatText_left)UIPackage.CreateObject("LG_AIchat", "item_chatText_left");
com_msg.text_content.text = _ChatItem.content_list[i].text_content;
// if (chat_index == 0) com_msg.head.url = "ui://tksc66j2ljeg27";
// else if (chat_index == 1) com_msg.head.url = "ui://tksc66j2ljeg25";
// else if (chat_index == 2) com_msg.head.url = "ui://tksc66j2ljeg20";
com_msg.type.selectedIndex = chat_index;
ui.list_.AddChild(com_msg);
}
}
if (list_count > 3) ui.list_.ScrollToView(list_count - 1);
ChatHelper.CheckReply();
}
else
{
ChatHelper.GetMessage(chat_index);
DOVirtual.DelayedCall(1, () =>
{
ChatHelper.CheckReply();
});
}
// DataMgr.ChatData.Value = "";
ui.btn_send.SetClick(() =>
{
if (DataMgr.ChatFreeNumber.Value > 0 || DataMgr.ChatNumber.Value > 0)
{
if (ui.input_message.text.IsNullOrWhiteSpace())
{
GameHelper.ShowTips("message_tips", true);
return;
}
Debug.Log(ui.input_message.text.Length);
if (ui.input_message.text.Length > 200)
{
GameHelper.ShowTips("character_limit", true);
return;
}
if (DataMgr.ChatFreeNumber.Value > 0)
{
DataMgr.ChatFreeNumber.Value--;
}
else DataMgr.ChatNumber.Value--;
setChatNum();
ChatHelper.SendMessage(chat_index, ui.input_message.text);
list_count++;
DOVirtual.DelayedCall(4, () =>
{
Debug.Log("重复一次");
ChatHelper.CheckReply();
});
if (have_inputani)
{
ui.list_.RemoveChildAt(ui.list_.numItems - 1);
}
item_chatText_right com_msg = (item_chatText_right)UIPackage.CreateObject("LG_AIchat", "item_chatText_right");
com_msg.text_content.text = ui.input_message.text;
GameHelper.SetSelfAvatar(com_msg.btn_head.load_avatar, DataMgr.PlayerAvatarId.Value);
ui.list_.AddChild(com_msg);
item_chatText_left com_msg_ = (item_chatText_left)UIPackage.CreateObject("LG_AIchat", "item_chatText_left");
com_msg_.t0.Play(-1, 0, null);
// if (chat_index == 0) com_msg_.head.url = "ui://tksc66j2ljeg27";
// else if (chat_index == 1) com_msg_.head.url = "ui://tksc66j2ljeg25";
// else if (chat_index == 2) com_msg_.head.url = "ui://tksc66j2ljeg20";
com_msg_.type.selectedIndex = chat_index;
ui.list_.AddChild(com_msg_);
have_inputani = true;
if (_ChatItem == null)
{
_ChatItem = new ChatItem()
{
role = ChatType.GetType(chat_index),
content_list = new List<ChatText>(),
};
DataMgr.ChatData.Value.Add(_ChatItem);
}
_ChatItem.content_list.Add(new ChatText()
{
type = 0,
text_content = ui.input_message.text,
chat_time = GameHelper.GetNowTime(),
});
DataMgr.ChatData.Save();
ui.input_message.text = "";
ui.list_.ScrollToView(ui.list_.numItems - 1);
DOVirtual.DelayedCall(1, () =>
{
ChatHelper.CheckReply();
});
}
else
{
uiCtrlDispatcher.Dispatch(UICtrlMsg.ChatNumberUI_Open);
}
});
}
private bool have_inputani = false;
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 58ebdba9853c84405a4a4b497e81179c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,19 +1,19 @@
namespace FlowerPower
namespace LoveLegend
{
public class AddviewnewUICtrl : BaseUICtrl
public class ChatUICtrl : BaseUICtrl
{
private AddviewnewUI ui;
private AddviewnewModel model;
private ChatUI ui;
private ChatModel model;
private uint openUIMsg = UICtrlMsg.AddviewnewUI_Open;
private uint closeUIMsg = UICtrlMsg.AddviewnewUI_Close;
private uint openUIMsg = UICtrlMsg.ChatUI_Open;
private uint closeUIMsg = UICtrlMsg.ChatUI_Close;
#region
protected override void OnInit()
{
//model = ModuleManager.Instance.GetModel(ModelConst.AddviewnewModel) as AddviewnewModel;
//model = ModuleManager.Instance.GetModel(ModelConst.ChatModel) as ChatModel;
}
protected override void OnDispose()
@@ -24,7 +24,7 @@ namespace FlowerPower
{
if (ui == null)
{
ui = new AddviewnewUI(this);
ui = new ChatUI(this);
ui.Open(args);
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c8deb89af60a64834a3b0153598b0040
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 3aae7ebf11eadaf4a958264cdaa84eb2
guid: dacd1cefc6cec44538462f38924495ef
folderAsset: yes
DefaultImporter:
externalObjects: {}
@@ -1,18 +1,18 @@
namespace FlowerPower
namespace LoveLegend
{
public class AddviewnewCtrl : BaseCtrl
public class ChatChooseCtrl : BaseCtrl
{
public static AddviewnewCtrl Instance { get; private set; }
public static ChatChooseCtrl Instance { get; private set; }
private AddviewnewModel model;
private ChatChooseModel model;
#region
protected override void OnInit()
{
Instance = this;
//model = ModuleManager.Instance..GetModel(ModelConst.AddviewnewModel) as AddviewnewModel;
//model = ModuleManager.Instance..GetModel(ModelConst.ChatChooseModel) as ChatChooseModel;
}
protected override void OnDispose()
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 9eb2f8cf020ff4c0eb19c2f692b8671a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,20 @@
namespace LoveLegend
{
public class ChatChooseModel : BaseModel
{
#region
protected override void OnInit()
{
}
protected override void OnDispose()
{
}
#endregion
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 7c92b4256954442228fec21a2bea9c70
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,161 @@
using FGUI.ZM_Common_01;
using UnityEngine;
using FairyGUI;
using IgnoreOPS;
using SGModule.Common.Extensions;
namespace LoveLegend
{
public class ChatChooseUI : BaseUI
{
private ChatChooseUICtrl ctrl;
private ChatChooseModel model;
private FGUI.LG_AIchat.com_chatChoose ui;
public ChatChooseUI(ChatChooseUICtrl ctrl) : base(ctrl)
{
uiName = UIConst.ChatChooseUI;
this.ctrl = ctrl;
}
protected override void SetUIInfo(UIInfo uiInfo)
{
uiInfo.packageName = "LG_AIchat";
uiInfo.assetName = "com_chatChoose";
uiInfo.layerType = UILayerType.Popup;
uiInfo.isNeedOpenAnim = false;
uiInfo.isNeedCloseAnim = false;
uiInfo.isNeedUIMask = true;
}
#region
protected override void OnInit()
{
//model = ModuleManager.Instance.GetModel(ModelConst.ChatChooseModel) as ChatChooseModel;
}
protected override void OnClose()
{
}
protected override void OnBind()
{
ui = baseUI as FGUI.LG_AIchat.com_chatChoose;
}
protected override void OnOpenBefore(object args)
{
if (Screen.safeArea.y != 0)
{
ui.btn_gold.y += Screen.safeArea.y - 15;
}
InitView();
ui.btn_close.SetClick(() =>
{
uiCtrlDispatcher.Dispatch(UICtrlMsg.ChatChooseUI_Close);
});
RefreshRed();
ui.btn_0.SetClick(() =>
{
if (DataMgr.IsUnlockChat.Value < 0 && !GameHelper.GetVipPrivilege(Subscription.UnlockAssitant.As<int>()))//未解锁。
{
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.SecretUnlockUI_Open, 3);
}
else
{
if (DataMgr.IsUnlockChat.Value == 0)
{
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.UnlockTipsUI_Open, 3);
}
else
{
uiCtrlDispatcher.Dispatch(UICtrlMsg.ChatUI_Open, 0);
}
}
});
ui.btn_1.SetClick(() =>
{
if (DataMgr.IsUnlockChat.Value < 0 && !GameHelper.GetVipPrivilege(Subscription.UnlockAssitant.As<int>()))//未解锁。
{
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.SecretUnlockUI_Open, 3);
}
else
{
if (DataMgr.IsUnlockChat.Value == 0)
{
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.UnlockTipsUI_Open, 3);
}
else
{
uiCtrlDispatcher.Dispatch(UICtrlMsg.ChatUI_Open, 1);
}
}
});
ui.btn_2.SetClick(() =>
{
if (DataMgr.IsUnlockChat.Value < 0 && !GameHelper.GetVipPrivilege(Subscription.UnlockAssitant.As<int>()))//未解锁。
{
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.SecretUnlockUI_Open, 3);
}
else
{
if (DataMgr.IsUnlockChat.Value == 0)
{
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.UnlockTipsUI_Open, 3);
}
else
{
uiCtrlDispatcher.Dispatch(UICtrlMsg.ChatUI_Open, 2);
}
}
});
}
public void SetTopCurr(object a = null)
{
var btn_gold = ui.btn_gold as com_gold;
btn_gold.text_gold.text = $"{DataMgr.Coin.Value:N0}";
}
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.Gold_refresh, SetTopCurr);
GameDispatcher.Instance.AddListener(GameMsg.RefreshRedDot, RefreshRed);
}
protected override void RemoveListener()
{
GameDispatcher.Instance.RemoveListener(GameMsg.Gold_refresh, SetTopCurr);
GameDispatcher.Instance.RemoveListener(GameMsg.RefreshRedDot, RefreshRed);
}
#endregion
private void RefreshRed(object isShow = null)
{
ui.btn_0.red.visible = ChatHelper.GetChatRed(0);
ui.btn_1.red.visible = ChatHelper.GetChatRed(1);
ui.btn_2.red.visible = ChatHelper.GetChatRed(2);
}
//初始化页面逻辑
private void InitView()
{
SetTopCurr();
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 83e9ae6711260435092c4e1af2e4ff5c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,73 @@
namespace LoveLegend
{
public class ChatChooseUICtrl : BaseUICtrl
{
private ChatChooseUI ui;
private ChatChooseModel model;
private uint openUIMsg = UICtrlMsg.ChatChooseUI_Open;
private uint closeUIMsg = UICtrlMsg.ChatChooseUI_Close;
#region
protected override void OnInit()
{
//model = ModuleManager.Instance.GetModel(ModelConst.ChatChooseModel) as ChatChooseModel;
}
protected override void OnDispose()
{
}
public override void OpenUI(object args = null)
{
if (ui == null)
{
ui = new ChatChooseUI(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: d217670d04bcc416790bd6b0d443de38
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ad5fec9f1e982489eb60757842ee45e9
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,18 +1,18 @@
namespace FlowerPower
namespace LoveLegend
{
public class AddViewoffCtrl : BaseCtrl
public class ChatNumberCtrl : BaseCtrl
{
public static AddViewoffCtrl Instance { get; private set; }
public static ChatNumberCtrl Instance { get; private set; }
private AddViewoffModel model;
private ChatNumberModel model;
#region
protected override void OnInit()
{
Instance = this;
//model = ModuleManager.Instance..GetModel(ModelConst.AddViewoffModel) as AddViewoffModel;
//model = ModuleManager.Instance..GetModel(ModelConst.ChatNumberModel) as ChatNumberModel;
}
protected override void OnDispose()
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 0f1c72491f98a47f9984461d5b5797ec
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,20 @@
namespace LoveLegend
{
public class ChatNumberModel : BaseModel
{
#region
protected override void OnInit()
{
}
protected override void OnDispose()
{
}
#endregion
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: b99d4915960364dcf83eda361634c06c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,116 @@
using FGUI.ZM_Common_01;
using UnityEngine;
using FairyGUI;
namespace LoveLegend
{
public class ChatNumberUI : BaseUI
{
private ChatNumberUICtrl ctrl;
private ChatNumberModel model;
private FGUI.LG_AIchat.com_ChatNumber ui;
public ChatNumberUI(ChatNumberUICtrl ctrl) : base(ctrl)
{
uiName = UIConst.ChatNumberUI;
this.ctrl = ctrl;
}
protected override void SetUIInfo(UIInfo uiInfo)
{
uiInfo.packageName = "LG_AIchat";
uiInfo.assetName = "com_ChatNumber";
uiInfo.layerType = UILayerType.Popup;
uiInfo.isNeedOpenAnim = false;
uiInfo.isNeedCloseAnim = false;
uiInfo.isNeedUIMask = true;
}
#region
protected override void OnInit()
{
//model = ModuleManager.Instance.GetModel(ModelConst.ChatNumberModel) as ChatNumberModel;
}
protected override void OnClose()
{
}
protected override void OnBind()
{
ui = baseUI as FGUI.LG_AIchat.com_ChatNumber;
}
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()
{
ui.btn_close.SetClick(() =>
{
CtrlCloseUI();
});
int[] array = GameHelper.GetCommonModel().CoinsAccess;
ui.text_coins.SetVar("coin", array[0].ToString()).FlushVars();
ui.text_coins.SetVar("num", array[1].ToString()).FlushVars();
ui.text_ads.SetVar("num", GameHelper.GetCommonModel().AdAccess.ToString()).FlushVars();
ui.btn_coins.title = array[0].ToString();
ui.btn_coins.SetClick(() =>
{
if (DataMgr.Coin.Value >= array[0])
{
DataMgr.Coin.Value -= array[0];
DataMgr.ChatNumber.Value += array[1];
GameDispatcher.Instance.Dispatch(GameMsg.AddChatNum);
GameDispatcher.Instance.Dispatch(GameMsg.Gold_refresh);
CtrlCloseUI();
GameHelper.ShowTips("more_message", true);
}
else GameHelper.ShowTips("no_enough_gold", true);
});
ui.btn_watch.SetClick(() =>
{
GameHelper.ShowVideoAd("TaskReward", (issuccess) =>
{
if (issuccess)
{
DataMgr.ChatNumber.Value += GameHelper.GetCommonModel().AdAccess;
GameDispatcher.Instance.Dispatch(GameMsg.AddChatNum);
CtrlCloseUI();
GameHelper.ShowTips("more_message", true);
}
});
});
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 6aa550f4b878c46b1b94f94bd8344e29
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,73 @@
namespace LoveLegend
{
public class ChatNumberUICtrl : BaseUICtrl
{
private ChatNumberUI ui;
private ChatNumberModel model;
private uint openUIMsg = UICtrlMsg.ChatNumberUI_Open;
private uint closeUIMsg = UICtrlMsg.ChatNumberUI_Close;
#region
protected override void OnInit()
{
//model = ModuleManager.Instance.GetModel(ModelConst.ChatNumberModel) as ChatNumberModel;
}
protected override void OnDispose()
{
}
public override void OpenUI(object args = null)
{
if (ui == null)
{
ui = new ChatNumberUI(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: cfc256c0532ea497899ef69ce0fc0e54
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 327b4267fce094111a78bb54bdb1e83c
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,25 @@
namespace LoveLegend
{
public class ChatUnlockCtrl : BaseCtrl
{
public static ChatUnlockCtrl Instance { get; private set; }
private ChatUnlockModel model;
#region
protected override void OnInit()
{
Instance = this;
//model = ModuleManager.Instance..GetModel(ModelConst.ChatUnlockModel) as ChatUnlockModel;
}
protected override void OnDispose()
{
Instance = null;
}
#endregion
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 7c093fabf4fa34bf4a1fb3482d8f9761
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,20 @@
namespace LoveLegend
{
public class ChatUnlockModel : BaseModel
{
#region
protected override void OnInit()
{
}
protected override void OnDispose()
{
}
#endregion
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 47d86987ec02a450ea21d30862f75ef1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,92 @@
using FGUI.ZM_Common_01;
using UnityEngine;
using FairyGUI;
using Spine.Unity;
using System;
namespace LoveLegend
{
public class ChatUnlockUI : BaseUI
{
private ChatUnlockUICtrl ctrl;
private ChatUnlockModel model;
private FGUI.LG_Unlock.com_chatUnlock ui;
public ChatUnlockUI(ChatUnlockUICtrl ctrl) : base(ctrl)
{
uiName = UIConst.ChatUnlockUI;
this.ctrl = ctrl;
}
protected override void SetUIInfo(UIInfo uiInfo)
{
uiInfo.packageName = "LG_Unlock";
uiInfo.assetName = "com_chatUnlock";
uiInfo.layerType = UILayerType.Popup;
uiInfo.isNeedOpenAnim = false;
uiInfo.isNeedCloseAnim = false;
uiInfo.isNeedUIMask = true;
}
#region
protected override void OnInit()
{
//model = ModuleManager.Instance.GetModel(ModelConst.ChatUnlockModel) as ChatUnlockModel;
}
protected override void OnClose()
{
closeCallback?.Invoke();
}
protected override void OnBind()
{
ui = baseUI as FGUI.LG_Unlock.com_chatUnlock;
}
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 Action closeCallback;
//初始化页面逻辑
private void InitView()
{
SkeletonAnimation ske_pot = FXManager.Instance.SetFx<SkeletonAnimation>(ui.ani_parent, Fx_Type.fx_chatunlock, ref closeCallback);
ske_pot.state.SetAnimation(0, "animation", true);
SkeletonAnimation ske_pot1 = FXManager.Instance.SetFx<SkeletonAnimation>(ui.ani_parent1, Fx_Type.fx_chatunlock1, ref closeCallback);
ske_pot1.state.SetAnimation(0, "animation", true);
SkeletonAnimation ske_pot2 = FXManager.Instance.SetFx<SkeletonAnimation>(ui.ani_parent2, Fx_Type.fx_chatunlock2, ref closeCallback);
ske_pot2.state.SetAnimation(0, "animation", true);
ui.btn_close.SetClick(CtrlCloseUI);
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d75d7fcc65bbb4bd9bea1bbe54ce9bdd
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,73 @@
namespace LoveLegend
{
public class ChatUnlockUICtrl : BaseUICtrl
{
private ChatUnlockUI ui;
private ChatUnlockModel model;
private uint openUIMsg = UICtrlMsg.ChatUnlockUI_Open;
private uint closeUIMsg = UICtrlMsg.ChatUnlockUI_Close;
#region
protected override void OnInit()
{
//model = ModuleManager.Instance.GetModel(ModelConst.ChatUnlockModel) as ChatUnlockModel;
}
protected override void OnDispose()
{
}
public override void OpenUI(object args = null)
{
if (ui == null)
{
ui = new ChatUnlockUI(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: e758e321c0de44349be76c88070b8e85
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,4 +1,4 @@
namespace FlowerPower
namespace LoveLegend
{
public class ChoosePropCtrl : BaseCtrl
{
@@ -1,4 +1,4 @@
namespace FlowerPower
namespace LoveLegend
{
public class ChoosePropModel : BaseModel
{
@@ -1,13 +1,10 @@
using FairyGUI;
using UnityEngine;
namespace FlowerPower
namespace LoveLegend
{
public class ChoosePropUI : BaseUI
{
private ChoosePropUICtrl ctrl;
private ChoosePropModel model;
private FGUI.P09_ChooseProp.com_choose ui;
private FGUI.ZM_Prop_09.com_choose ui;
public ChoosePropUI(ChoosePropUICtrl ctrl) : base(ctrl)
{
@@ -17,7 +14,7 @@ namespace FlowerPower
protected override void SetUIInfo(UIInfo uiInfo)
{
uiInfo.packageName = "P09_ChooseProp";
uiInfo.packageName = "ZM_Prop_09";
uiInfo.assetName = "com_choose";
uiInfo.layerType = UILayerType.Popup;
uiInfo.isNeedOpenAnim = false;
@@ -37,7 +34,7 @@ namespace FlowerPower
protected override void OnBind()
{
ui = baseUI as FGUI.P09_ChooseProp.com_choose;
ui = baseUI as FGUI.ZM_Prop_09.com_choose;
}
protected override void OnOpenBefore(object args)
@@ -74,11 +71,11 @@ namespace FlowerPower
{
// Debug.Log(GameHelper.GetLevelstate());
int state = GameHelper.GetLevelstate();
int need_gold = ConfigSystem.GetConfig<CommonModel>().RevivalCoins;
int need_gold = ConfigSystem.GetCommonConf().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);
@@ -87,8 +84,9 @@ namespace FlowerPower
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);
temp.boost_array = GameHelper.GetRewardBoost(2);
temp.level = GameHelper.GetLevel();
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.NewEndUI_Open, temp);
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.ChoosePropUI_Close);
});
@@ -101,8 +99,9 @@ namespace FlowerPower
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);
temp.boost_array = GameHelper.GetRewardBoost(2);
temp.level = GameHelper.GetLevel();
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.NewEndUI_Open, temp);
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.ChoosePropUI_Close);
});
@@ -111,7 +110,7 @@ namespace FlowerPower
private void initProp(int state)
{
int need_gold = ConfigSystem.GetConfig<CommonModel>().RevivalCoins;
int need_gold = ConfigSystem.GetCommonConf().RevivalCoins;
if (state == 3)
{
@@ -141,7 +140,7 @@ namespace FlowerPower
}
else
{
GameHelper.ShowTips("Not enough gold");
GameHelper.ShowTips("no_enough_gold", true);
}
});
@@ -179,7 +178,7 @@ namespace FlowerPower
}
else
{
GameHelper.ShowTips("Not enough gold");
GameHelper.ShowTips("no_enough_gold", true);
}
});
@@ -187,4 +186,4 @@ namespace FlowerPower
}
}
}
}
@@ -1,4 +1,4 @@
namespace FlowerPower
namespace LoveLegend
{
public class ChoosePropUICtrl : BaseUICtrl
{
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 141317c3032f4463da09be3c37e26ba8
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 83f9eb69747b240dcb54855ff322ac86
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
-240
View File
@@ -1,240 +0,0 @@
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
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 5a9bee451b15a47eaaa4a44e93ccba93
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
-157
View File
@@ -1,157 +0,0 @@
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
}
}
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: c21a94c563a4b4e1f8aebe5935b398c0
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+1 -1
View File
@@ -1,5 +1,5 @@
namespace FlowerPower
namespace LoveLegend
{
public class FXWndCtrl : BaseCtrl
{
+1 -1
View File
@@ -1,6 +1,6 @@
namespace FlowerPower
namespace LoveLegend
{
public class FXWndModel : BaseModel
{
+4 -4
View File
@@ -5,13 +5,13 @@ using FairyGUI;
using Spine.Unity;
namespace FlowerPower
namespace LoveLegend
{
public class FXWndUI : BaseUI
{
private FXWndUICtrl ctrl;
private FXWndModel model;
private FGUI.P502_Fx.com_FX ui;
private FGUI.ZM_Fx_502.com_FX ui;
private Transform parTrf;
@@ -23,7 +23,7 @@ namespace FlowerPower
protected override void SetUIInfo(UIInfo uiInfo)
{
uiInfo.packageName = "P502_Fx";
uiInfo.packageName = "ZM_Fx_502";
uiInfo.assetName = "com_FX";
uiInfo.layerType = UILayerType.Animation;
}
@@ -101,7 +101,7 @@ namespace FlowerPower
protected override void OnBind()
{
ui = baseUI as FGUI.P502_Fx.com_FX;
ui = baseUI as FGUI.ZM_Fx_502.com_FX;
}
protected override void OnOpenBefore(object args)
+1 -1
View File
@@ -1,6 +1,6 @@
namespace FlowerPower
namespace LoveLegend
{
public class FXWndUICtrl : BaseUICtrl
{
@@ -1,4 +1,4 @@
namespace FlowerPower
namespace LoveLegend
{
public class FirstRewardCtrl : BaseCtrl
{
@@ -1,4 +1,4 @@
namespace FlowerPower
namespace LoveLegend
{
public class FirstRewardModel : BaseModel
{

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