fix:1、添加项目
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace FlowerPower
|
||||
{
|
||||
public class ResurgenceCtrl : BaseCtrl
|
||||
{
|
||||
public static ResurgenceCtrl Instance { get; private set; }
|
||||
|
||||
private ResurgenceModel model;
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
Instance = this;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
Instance = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4d56a2d552aac4144bd57d8ba295b6fc
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,13 @@
|
||||
namespace FlowerPower
|
||||
{
|
||||
public class ResurgenceModel : BaseModel
|
||||
{
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0a39a114043b6494f946e195cd413673
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,311 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using FutureCore;
|
||||
using FairyGUI;
|
||||
using FGUI.failpack;
|
||||
using System;
|
||||
using FGUI.P01_Common;
|
||||
using DG.Tweening;
|
||||
|
||||
namespace FlowerPower
|
||||
{
|
||||
public class ResurgenceUI : BaseUI
|
||||
{
|
||||
private ResurgenceUICtrl ctrl;
|
||||
private ResurgenceModel model;
|
||||
private FGUI.failpack.com_resurgence ui;
|
||||
|
||||
public ResurgenceUI(ResurgenceUICtrl ctrl) : base(ctrl)
|
||||
{
|
||||
uiName = UIConst.ResurgenceUI;
|
||||
this.ctrl = ctrl;
|
||||
}
|
||||
private float progress_value;
|
||||
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
uiInfo.packageName = "failpack";
|
||||
uiInfo.assetName = "com_resurgence";
|
||||
uiInfo.layerType = UILayerType.Popup;
|
||||
uiInfo.isNeedOpenAnim = false;
|
||||
uiInfo.isNeedCloseAnim = false;
|
||||
uiInfo.isNeedUIMask = true;
|
||||
}
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
GameHelper.CallShowTurn();
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as FGUI.failpack.com_resurgence;
|
||||
}
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
|
||||
Debug.Log(args);
|
||||
progress_value = (float)args * 100;
|
||||
|
||||
if (GameHelper.IsGiftSwitch())
|
||||
{
|
||||
ui.broad.visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.broad.visible = false;
|
||||
}
|
||||
InitView();
|
||||
NetworkKit.BuriedPoint(BuriedPointEvent.Apple_pay_event, BuriedPointEvent.fail_show, 1);
|
||||
InitBroadCast();
|
||||
}
|
||||
|
||||
protected override void OnOpen(object args)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnHide()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDisplay(object args)
|
||||
{
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 消息
|
||||
protected override void AddListener()
|
||||
{
|
||||
if (GameHelper.IsAdModelOfPay())
|
||||
{
|
||||
HallManager.Instance.UpdateSecondEvent += InitView;
|
||||
}
|
||||
GameDispatcher.Instance.AddListener(GameMsg.apple_pay_success, pay_success);
|
||||
HallManager.Instance.UpdateSecondEvent += updatEevent;
|
||||
}
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
if (GameHelper.IsAdModelOfPay())
|
||||
{
|
||||
HallManager.Instance.UpdateSecondEvent -= InitView;
|
||||
}
|
||||
GameDispatcher.Instance.RemoveListener(GameMsg.apple_pay_success, pay_success);
|
||||
HallManager.Instance.UpdateSecondEvent -= updatEevent;
|
||||
}
|
||||
#endregion
|
||||
private void updatEevent()
|
||||
{
|
||||
ui.text_remain.text = CommonHelper.TimeFormat((int)(SaveData.GetSaveobject().failed_pack_time - Convert.ToInt32(GameHelper.GetNowTime())), CountDownType.Hour);
|
||||
broadtime++;
|
||||
BroadCast();
|
||||
}
|
||||
void pay_success(object str)
|
||||
{
|
||||
string type = (string)str;
|
||||
Debug.Log("77777777777777777777777777" + type);
|
||||
if (type == PurchasingManager.fail_pack)
|
||||
{
|
||||
|
||||
var start = GameHelper.GetUICenterPosition(ui.bg);
|
||||
//var end = GameHelper.GetUICenterPosition(ui.gold.GetChild("text_gold"));
|
||||
|
||||
// reward_data temp = new reward_data() { start = start, end = end, change = list[1].coins_quantity, type = 101 };
|
||||
// UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.CoinWnd_newUI_Open, temp);
|
||||
|
||||
|
||||
// DOVirtual.DelayedCall(1, () =>
|
||||
// {
|
||||
// DOVirtual.Float(0, (float)PreferencesMgr.Instance.Currency101, 1,
|
||||
// value => { ui.gold.GetChild("text_gold").text = GameHelper.Get101Str((decimal)value); });
|
||||
// });
|
||||
|
||||
var rewardData = new RewardData();
|
||||
var end = GameHelper.GetUICenterPosition(ui.end_point);
|
||||
|
||||
var rewardSingleData = new RewardSingleData(101, list[2].coins_quantity, RewardOrigin.AdTask)
|
||||
{
|
||||
startPosition = start,
|
||||
endPosition = end
|
||||
};
|
||||
|
||||
rewardData.AddReward(rewardSingleData);
|
||||
rewardData.displayType = RewardDisplayType.RewardFly | RewardDisplayType.ValueChange;
|
||||
rewardData.AddCompleted(success =>
|
||||
{
|
||||
// if (success)
|
||||
// {
|
||||
// RefreshGold(awardNum);
|
||||
// }
|
||||
});
|
||||
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.GetReward, rewardData);
|
||||
// PreferencesMgr.Instance.Currency101 -= list[1].coins_quantity;
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.ResurgenceUI_Close);
|
||||
}
|
||||
|
||||
}
|
||||
private List<Paidgift> list;
|
||||
//初始化页面逻辑
|
||||
private void InitView()
|
||||
{
|
||||
if (SaveData.GetSaveobject().failed_pack_time < GameHelper.GetNowTime())
|
||||
{
|
||||
SaveData.GetSaveobject().failed_pack_time = (int)GameHelper.GetNowTime() + GameHelper.GetCommonModel().FailedGiftCD;
|
||||
}
|
||||
Debug.Log("?????????");
|
||||
ui.btn_back.SetClick(() =>
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.ResurgenceUI_Close);
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.resurgence_close);
|
||||
});
|
||||
list = ConfigSystem.GetConfig<PaidgiftModel>().dataList;
|
||||
int gold_num = list[2].coins_quantity;
|
||||
int back_num = list[2].props_quantity[1];
|
||||
int out_num = list[2].props_quantity[0];
|
||||
int refresh_num = list[2].props_quantity[2];
|
||||
ui.text_outnum.text = "x" + out_num;
|
||||
ui.text_backnum.text = "x" + back_num;
|
||||
ui.text_refreshnum.text = "x" + refresh_num;
|
||||
ui.text_goldnum.text = "x" + gold_num;
|
||||
ui.text_progress.text = "Completion:" + Math.Round(progress_value) + "%";
|
||||
ui.progress_1.value = progress_value;
|
||||
if (!GameHelper.IsAdModelOfPay())
|
||||
{
|
||||
ui.pay_type.selectedIndex = 1;
|
||||
|
||||
decimal price = (decimal)list[2].Paid_price2;
|
||||
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.fail_pack,
|
||||
currency = "USD"
|
||||
};
|
||||
MaxPayManager.Instance.Buy(maxPayData);
|
||||
});
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
btn_watchAd btn_ad_buy = ui.btn_buy as btn_watchAd;
|
||||
ui.text_have.text = "Owner ADs:" + AdRdManager.Instance.GetLookRewardADNum();
|
||||
ui.need_text.text = "need " + list[2].Paid_price + " ADs";
|
||||
btn_ad_buy.img_saveingpot.visible = false;
|
||||
// btn_ad_buy.SetClick(() =>
|
||||
// {
|
||||
// GameDispatcher.Instance.Dispatch(GameMsg.resurgence);
|
||||
// UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.ResurgenceUI_Close);
|
||||
// });
|
||||
|
||||
|
||||
int nums = PlayerPrefs.GetInt("get_look_reward_ad_num", 0);
|
||||
if (nums >= list[2].Paid_price)
|
||||
{
|
||||
btn_ad_buy.buy_state.selectedIndex = 1;
|
||||
btn_ad_buy.can_buy.selectedIndex = 0;
|
||||
btn_ad_buy.SetClick(() =>
|
||||
{
|
||||
// ApplePayClass test = new ApplePayClass()
|
||||
// {
|
||||
// sku = PurchasingManager.fail_pack,
|
||||
// };
|
||||
// PurchasingManager.Instance.Purchase(PurchasingManager.fail_pack, test);
|
||||
AdRdData adRdData = new AdRdData()
|
||||
{
|
||||
type = PurchasingManager.fail_pack,
|
||||
ad_count = (int)list[2].Paid_price
|
||||
};
|
||||
AdRdManager.Instance.Rd(adRdData);
|
||||
|
||||
// nums -= (int)list[2].Paid_price;
|
||||
//PlayerPrefs.SetInt("get_look_reward_ad_num", nums);
|
||||
NetworkKit.BuriedPoint(BuriedPointEvent.Apple_pay_event, BuriedPointEvent.fail_buy_success, 1);
|
||||
});
|
||||
}
|
||||
else if (SaveData.GetSaveobject()._watch_ad_cd > GameHelper.GetNowTime())
|
||||
{
|
||||
btn_ad_buy.buy_state.selectedIndex = 0;
|
||||
btn_ad_buy.can_buy.selectedIndex = 1;
|
||||
btn_ad_buy.btn_text.text = CommonHelper.TimeFormat(SaveData.GetSaveobject()._watch_ad_cd - Convert.ToInt32(GameHelper.GetNowTime()), CountDownType.Hour);
|
||||
btn_ad_buy.SetClick(() =>
|
||||
{
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
btn_ad_buy.buy_state.selectedIndex = 0;
|
||||
btn_ad_buy.can_buy.selectedIndex = 0;
|
||||
//btn_ad_buy.text = "Watch AD";
|
||||
if (GameHelper.IsGiftSwitch() && ConfigSystem.GetConfig<CommonModel>().PiggyBankSwitch == 1) btn_ad_buy.img_saveingpot.visible = true;
|
||||
btn_ad_buy.SetClick(() =>
|
||||
{
|
||||
GameHelper.ShowVideoAd("Pass", (issuccess) =>
|
||||
{
|
||||
if (issuccess)
|
||||
{
|
||||
SaveData.GetSaveobject()._watch_ad_cd = (int)GameHelper.GetNowTime() + GameHelper.GetCommonModel().exchangeCD;
|
||||
InitView();
|
||||
|
||||
}
|
||||
});
|
||||
NetworkKit.BuriedPoint(BuriedPointEvent.Apple_pay_event, BuriedPointEvent.fail_click, 1);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
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 Failure Gift Package,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 Failure Gift Package,play [color=#ad4800]" + broad_list[i][1] + "[/color] matcher to clear the level!";
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fb8f89f92a98b4317be64d4c14d8f602
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,76 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace FlowerPower
|
||||
|
||||
{
|
||||
public class ResurgenceUICtrl : BaseUICtrl
|
||||
{
|
||||
private ResurgenceUI ui;
|
||||
private ResurgenceModel model;
|
||||
|
||||
private uint openUIMsg = UICtrlMsg.ResurgenceUI_Open;
|
||||
private uint closeUIMsg = UICtrlMsg.ResurgenceUI_Close;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.ResurgenceModel) as ResurgenceModel;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OpenUI(object args = null)
|
||||
{
|
||||
if (ui == null)
|
||||
{
|
||||
ui = new ResurgenceUI(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: ad517c5a5d56648249afb6f3adb0582d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user