2026-04-22 09:52:55 +08:00
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using FairyGUI;
|
|
|
|
|
using FGUI.threeDaysGift;
|
|
|
|
|
using Spine.Unity;
|
|
|
|
|
using DG.Tweening;
|
|
|
|
|
using System;
|
2026-04-22 11:13:16 +08:00
|
|
|
using SGModule.NetKit;
|
2026-04-22 09:52:55 +08:00
|
|
|
|
2026-04-22 11:13:16 +08:00
|
|
|
namespace LoveLegend
|
2026-04-22 09:52:55 +08:00
|
|
|
{
|
|
|
|
|
public class ThreeDaysGiftUI : BaseUI
|
|
|
|
|
{
|
|
|
|
|
private ThreeDaysGiftUICtrl ctrl;
|
|
|
|
|
private ThreeDaysGiftModel model;
|
|
|
|
|
private FGUI.threeDaysGift.com_three_days ui;
|
|
|
|
|
|
|
|
|
|
public ThreeDaysGiftUI(ThreeDaysGiftUICtrl ctrl) : base(ctrl)
|
|
|
|
|
{
|
|
|
|
|
uiName = UIConst.ThreeDaysGiftUI;
|
|
|
|
|
this.ctrl = ctrl;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void SetUIInfo(UIInfo uiInfo)
|
|
|
|
|
{
|
|
|
|
|
uiInfo.packageName = "threeDaysGift";
|
|
|
|
|
uiInfo.assetName = "com_three_days";
|
|
|
|
|
uiInfo.layerType = UILayerType.Popup;
|
|
|
|
|
uiInfo.isNeedOpenAnim = false;
|
|
|
|
|
uiInfo.isNeedCloseAnim = false;
|
|
|
|
|
uiInfo.isNeedUIMask = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region 生命周期
|
|
|
|
|
protected override void OnInit()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void OnClose()
|
|
|
|
|
{
|
|
|
|
|
HallManager.Instance.UpdateSecondEvent -= InitView;
|
|
|
|
|
GameHelper.showGameUI = true;
|
|
|
|
|
GameDispatcher.Instance.Dispatch(GameMsg.pack_close);
|
2026-04-22 11:13:16 +08:00
|
|
|
GameHelper.CallShowTurn();
|
2026-04-22 09:52:55 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void OnBind()
|
|
|
|
|
{
|
|
|
|
|
ui = baseUI as FGUI.threeDaysGift.com_three_days;
|
|
|
|
|
}
|
|
|
|
|
private Action closeCallback;
|
|
|
|
|
protected override void OnOpenBefore(object args)
|
|
|
|
|
{
|
|
|
|
|
|
2026-04-22 11:13:16 +08:00
|
|
|
TrackKit.SendEvent(GameHelper.GetEventName(), ADEventTrack.Property.three_days_gift_show);
|
2026-04-22 09:52:55 +08:00
|
|
|
|
2026-04-22 11:13:16 +08:00
|
|
|
list = ConfigSystem.GetConfig<Multigift>();
|
2026-04-22 09:52:55 +08:00
|
|
|
|
|
|
|
|
ui.btn_close.SetClick(() =>
|
|
|
|
|
{
|
|
|
|
|
GameDispatcher.Instance.Dispatch(GameMsg.ThreeDaysGiftUIClose);
|
|
|
|
|
CtrlCloseUI();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
ui.groups.visible = false;
|
|
|
|
|
|
|
|
|
|
var ske_bg = FXManager.Instance.SetFx<SkeletonAnimation>(ui.ani_bg, Fx_Type.fx_three_gift, ref closeCallback);
|
|
|
|
|
ske_bg.state.SetAnimation(0, "3_days", false);
|
|
|
|
|
ske_bg.state.Complete += (a) =>
|
|
|
|
|
{
|
|
|
|
|
ske_bg.state.SetAnimation(0, "3_days_dj", false);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
DOVirtual.DelayedCall(0.5f, () =>
|
|
|
|
|
{
|
|
|
|
|
ui.groups.visible = true;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
InitView();
|
|
|
|
|
HallManager.Instance.UpdateSecondEvent += InitView;
|
2026-04-22 11:13:16 +08:00
|
|
|
//
|
2026-04-22 09:52:55 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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.rewardMul_close, rewardMul_close);
|
|
|
|
|
}
|
|
|
|
|
protected override void RemoveListener()
|
|
|
|
|
{
|
|
|
|
|
GameDispatcher.Instance.RemoveListener(GameMsg.apple_pay_success, pay_success);
|
|
|
|
|
GameDispatcher.Instance.RemoveListener(GameMsg.rewardMul_close, rewardMul_close);
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
void pay_success(object str)
|
|
|
|
|
{
|
|
|
|
|
string type = (string)str;
|
2026-04-22 11:13:16 +08:00
|
|
|
if (type == PurchasingManager.GetPaySku(PayType.three_days_gift))
|
2026-04-22 09:52:55 +08:00
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// var start = Vector2.zero;
|
2026-04-22 11:13:16 +08:00
|
|
|
// if (SaveData.GetSaveObject().three_gift_got_index == (int)rewardState.day1) {
|
2026-04-22 09:52:55 +08:00
|
|
|
// start = GameHelper.GetUICenterPosition(ui.day1.item1.lab_num);
|
2026-04-22 11:13:16 +08:00
|
|
|
// } else if (SaveData.GetSaveObject().three_gift_got_index == (int)rewardState.day2) {
|
2026-04-22 09:52:55 +08:00
|
|
|
// start = GameHelper.GetUICenterPosition(ui.day2.item1.lab_num);
|
2026-04-22 11:13:16 +08:00
|
|
|
// } else if (SaveData.GetSaveObject().three_gift_got_index == (int)rewardState.day3) {
|
2026-04-22 09:52:55 +08:00
|
|
|
// start = GameHelper.GetUICenterPosition(ui.day3.item1.lab_num);
|
|
|
|
|
// }
|
2026-04-22 11:13:16 +08:00
|
|
|
//
|
2026-04-22 09:52:55 +08:00
|
|
|
// var rewardData = new RewardData();
|
|
|
|
|
// var end = GameHelper.GetUICenterPosition(ui.node_end);
|
2026-04-22 11:13:16 +08:00
|
|
|
//
|
2026-04-22 09:52:55 +08:00
|
|
|
// var rewardSingleData = new RewardSingleData(101, list[1].coins_quantity, RewardOrigin.AdTask)
|
|
|
|
|
// {
|
|
|
|
|
// startPosition = start,
|
|
|
|
|
// endPosition = end
|
|
|
|
|
// };
|
2026-04-22 11:13:16 +08:00
|
|
|
//
|
2026-04-22 09:52:55 +08:00
|
|
|
// rewardData.AddReward(rewardSingleData);
|
|
|
|
|
// rewardData.displayType = RewardDisplayType.RewardFly | RewardDisplayType.ValueChange;
|
|
|
|
|
// rewardData.AddCompleted(success =>
|
|
|
|
|
// {
|
|
|
|
|
// // if (success)
|
|
|
|
|
// // {
|
|
|
|
|
// // RefreshGold(awardNum);
|
|
|
|
|
// // }
|
|
|
|
|
// });
|
2026-04-22 11:13:16 +08:00
|
|
|
//
|
2026-04-22 09:52:55 +08:00
|
|
|
// GameDispatcher.Instance.Dispatch(GameMsg.GetReward, rewardData);
|
2026-04-22 11:13:16 +08:00
|
|
|
// // DataMgr.Coin.Value -= list[1].coins_quantity;
|
|
|
|
|
//
|
2026-04-22 09:52:55 +08:00
|
|
|
// UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.AdcomingUI_Close);
|
2026-04-22 11:13:16 +08:00
|
|
|
// SaveData.GetSaveObject().is_get_removead = true;
|
2026-04-22 09:52:55 +08:00
|
|
|
// InitView();
|
|
|
|
|
|
|
|
|
|
ui.pay_type.selectedIndex = 2;
|
|
|
|
|
}
|
|
|
|
|
// GameDispatcher.Instance.Dispatch(GameMsg.noads_refresh);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void rewardMul_close(object str)
|
|
|
|
|
{
|
2026-04-22 11:13:16 +08:00
|
|
|
if (SaveData.GetSaveObject().three_gift_got_index == (int)rewardState.day1)
|
2026-04-22 09:52:55 +08:00
|
|
|
{
|
2026-04-22 11:13:16 +08:00
|
|
|
TrackKit.SendEvent(ThreeDaysGiftEventTrack.Event, ThreeDaysGiftEventTrack.Property.three_day1_success);
|
2026-04-22 09:52:55 +08:00
|
|
|
}
|
2026-04-22 11:13:16 +08:00
|
|
|
else if (SaveData.GetSaveObject().three_gift_got_index == (int)rewardState.day2)
|
2026-04-22 09:52:55 +08:00
|
|
|
{
|
2026-04-22 11:13:16 +08:00
|
|
|
TrackKit.SendEvent(ThreeDaysGiftEventTrack.Event, ThreeDaysGiftEventTrack.Property.three_day2_success);
|
2026-04-22 09:52:55 +08:00
|
|
|
}
|
2026-04-22 11:13:16 +08:00
|
|
|
else if (SaveData.GetSaveObject().three_gift_got_index == (int)rewardState.day3)
|
2026-04-22 09:52:55 +08:00
|
|
|
{
|
2026-04-22 11:13:16 +08:00
|
|
|
TrackKit.SendEvent(ThreeDaysGiftEventTrack.Event, ThreeDaysGiftEventTrack.Property.three_day3_success);
|
2026-04-22 09:52:55 +08:00
|
|
|
}
|
|
|
|
|
|
2026-04-22 11:13:16 +08:00
|
|
|
SaveData.GetSaveObject().three_gift_got_index++;
|
|
|
|
|
SaveData.GetSaveObject().last_got_three_gift_time = GameHelper.GetNowTime();
|
2026-04-22 09:52:55 +08:00
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private List<Multigift> list;
|
|
|
|
|
|
2026-04-22 11:13:16 +08:00
|
|
|
// int adNums = AdExchangeManager.Instance.GetLookRewardADNum();
|
2026-04-22 09:52:55 +08:00
|
|
|
// adNums++;
|
2026-04-22 11:13:16 +08:00
|
|
|
// AdExchangeManager.Instance.SetLookRewardADNum(adNums);
|
2026-04-22 09:52:55 +08:00
|
|
|
private void InitView()
|
|
|
|
|
{
|
2026-04-22 11:13:16 +08:00
|
|
|
ui.text_have.text = Language.GetContentParams("owner_ad", AdExchangeManager.Instance.GetLookRewardADNum());
|
|
|
|
|
ui.need_text.text = Language.GetContentParams("need_ad", list[0].Paid_price);
|
|
|
|
|
|
2026-04-22 09:52:55 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
initItem(0);
|
|
|
|
|
initItem(1);
|
|
|
|
|
initItem(2);
|
|
|
|
|
|
|
|
|
|
FGUI.threeDaysGift.btn_watchAd btn_buypack = (ui.btn_buypack as FGUI.threeDaysGift.btn_watchAd);
|
|
|
|
|
GObject pack_title = ui.btn_buypack.GetChild("btn_text");
|
|
|
|
|
|
2026-04-22 11:13:16 +08:00
|
|
|
if (SaveData.GetSaveObject().is_get_ThreeDaysGift)
|
2026-04-22 09:52:55 +08:00
|
|
|
{
|
|
|
|
|
ui.pay_type.selectedIndex = 2;
|
2026-04-22 11:13:16 +08:00
|
|
|
var isToday = GameHelper.InToday(SaveData.GetSaveObject().last_got_three_gift_time, 0, true);
|
|
|
|
|
int three_gift_got_index = SaveData.GetSaveObject().three_gift_got_index;
|
2026-04-22 09:52:55 +08:00
|
|
|
if (isToday || (three_gift_got_index > (int)rewardState.day3))
|
|
|
|
|
{
|
|
|
|
|
ui.btn_get.grayed = true;
|
|
|
|
|
ui.btn_get.SetClick(() =>
|
|
|
|
|
{
|
|
|
|
|
if (three_gift_got_index < (int)rewardState.day3)
|
|
|
|
|
{
|
2026-04-22 11:13:16 +08:00
|
|
|
GameHelper.ShowTips("pick_tomorrow",true);
|
2026-04-22 09:52:55 +08:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
ui.btn_get.SetClick(() =>
|
|
|
|
|
{
|
|
|
|
|
getReward();
|
|
|
|
|
ui.btn_get.SetClick(() => { });
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (!GameHelper.IsAdModelOfPay())
|
|
|
|
|
{
|
|
|
|
|
ui.pay_type.selectedIndex = 1;
|
|
|
|
|
decimal price_pack = (decimal)list[0].Paid_price2;
|
2026-04-22 11:13:16 +08:00
|
|
|
ui.btn_max_pack.title = GameHelper.Get102Str(price_pack);
|
|
|
|
|
bool is_get = SaveData.GetSaveObject().is_get_ThreeDaysGift;
|
2026-04-22 09:52:55 +08:00
|
|
|
if (is_get)
|
|
|
|
|
{
|
|
|
|
|
ui.btn_max_pack.enabled = false;
|
|
|
|
|
ui.btn_max_pack.SetClick(() => { });
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2026-04-22 11:13:16 +08:00
|
|
|
|
2026-04-22 09:52:55 +08:00
|
|
|
ui.btn_max_pack.SetClick(() =>
|
|
|
|
|
{
|
|
|
|
|
ApplePayClass maxPayData = new ApplePayClass
|
|
|
|
|
{
|
|
|
|
|
amount = (int)Math.Round(price_pack * 100),
|
2026-04-22 11:13:16 +08:00
|
|
|
sku =PurchasingManager.GetPaySku(PayType.three_days_gift),
|
2026-04-22 09:52:55 +08:00
|
|
|
currency = "USD"
|
|
|
|
|
};
|
|
|
|
|
MaxPayManager.Instance.Buy(maxPayData);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
ui.pay_type.selectedIndex = 0;
|
|
|
|
|
|
2026-04-22 11:13:16 +08:00
|
|
|
bool is_get = SaveData.GetSaveObject().is_get_ThreeDaysGift;
|
2026-04-22 09:52:55 +08:00
|
|
|
if (is_get)
|
|
|
|
|
{
|
|
|
|
|
btn_buypack.buy_state.selectedIndex = 0;
|
|
|
|
|
btn_buypack.can_buy.selectedIndex = 1;
|
|
|
|
|
ui.btn_buypack.grayed = true;
|
2026-04-22 11:13:16 +08:00
|
|
|
pack_title.text = Language.GetContent("claimed");
|
2026-04-22 09:52:55 +08:00
|
|
|
ui.btn_buypack.SetClick(() =>
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
}
|
2026-04-22 11:13:16 +08:00
|
|
|
else if (AdExchangeManager.Instance.GetLookRewardADNum() >= list[0].Paid_price)
|
2026-04-22 09:52:55 +08:00
|
|
|
{
|
|
|
|
|
btn_buypack.buy_state.selectedIndex = 1;
|
|
|
|
|
btn_buypack.can_buy.selectedIndex = 0;
|
|
|
|
|
btn_buypack.SetClick(() =>
|
|
|
|
|
{
|
2026-04-22 11:13:16 +08:00
|
|
|
TrackKit.SendEvent(GameHelper.GetEventName(), ADEventTrack.Property.three_days_gift_buy_success);
|
|
|
|
|
// SaveData.GetSaveObject().look_ad_numbers
|
|
|
|
|
int adNums = AdExchangeManager.Instance.GetLookRewardADNum();
|
2026-04-22 09:52:55 +08:00
|
|
|
adNums -= (int)list[0].Paid_price;
|
2026-04-22 11:13:16 +08:00
|
|
|
AdExchangeManager.Instance.SetLookRewardADNum(adNums);
|
|
|
|
|
GameDispatcher.Instance.Dispatch(GameMsg.apple_pay_success, PurchasingManager.GetPaySku(PayType.three_days_gift));
|
2026-04-22 09:52:55 +08:00
|
|
|
|
|
|
|
|
// getReward();
|
|
|
|
|
ui.btn_buypack.SetClick(() => { });
|
|
|
|
|
});
|
|
|
|
|
}
|
2026-04-22 11:13:16 +08:00
|
|
|
else if (SaveData.GetSaveObject()._watch_ad_cd > GameHelper.GetNowTime())
|
2026-04-22 09:52:55 +08:00
|
|
|
{
|
|
|
|
|
btn_buypack.buy_state.selectedIndex = 0;
|
|
|
|
|
btn_buypack.can_buy.selectedIndex = 1;
|
2026-04-22 11:13:16 +08:00
|
|
|
pack_title.text = CommonHelper.TimeFormat(SaveData.GetSaveObject()._watch_ad_cd - Convert.ToInt32(GameHelper.GetNowTime()), CountDownType.Hour);
|
2026-04-22 09:52:55 +08:00
|
|
|
btn_buypack.SetClick(() => { });
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
btn_buypack.buy_state.selectedIndex = 0;
|
|
|
|
|
btn_buypack.can_buy.selectedIndex = 0;
|
2026-04-22 11:13:16 +08:00
|
|
|
|
|
|
|
|
pack_title.text = Language.GetContent("watch_ad");
|
2026-04-22 09:52:55 +08:00
|
|
|
btn_buypack.SetClick(() =>
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
GameHelper.ShowVideoAd("ThreeDaysGift", (issuccess) =>
|
|
|
|
|
{
|
|
|
|
|
if (issuccess)
|
|
|
|
|
{
|
2026-04-22 11:13:16 +08:00
|
|
|
SaveData.GetSaveObject()._watch_ad_cd = (int)GameHelper.GetNowTime() + GameHelper.GetCommonModel().exchangeCD;
|
2026-04-22 09:52:55 +08:00
|
|
|
InitView();
|
|
|
|
|
}
|
|
|
|
|
});
|
2026-04-22 11:13:16 +08:00
|
|
|
TrackKit.SendEvent(GameHelper.GetEventName(), ADEventTrack.Property.three_days_gift_click);
|
2026-04-22 09:52:55 +08:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void initItem(int index)
|
|
|
|
|
{
|
|
|
|
|
com_item day = null;
|
|
|
|
|
if (index == 0)
|
|
|
|
|
{
|
|
|
|
|
day = ui.day1;
|
|
|
|
|
}
|
|
|
|
|
else if (index == 1)
|
|
|
|
|
{
|
|
|
|
|
day = ui.day2;
|
|
|
|
|
}
|
|
|
|
|
else if (index == 2)
|
|
|
|
|
{
|
|
|
|
|
day = ui.day3;
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-22 11:13:16 +08:00
|
|
|
if (SaveData.GetSaveObject().three_gift_got_index - 1 > index)
|
2026-04-22 09:52:55 +08:00
|
|
|
{
|
|
|
|
|
day.img_select.visible = true;
|
2026-04-22 11:13:16 +08:00
|
|
|
if (SaveData.GetSaveObject().three_gift_got_index - 1 > 2)
|
2026-04-22 09:52:55 +08:00
|
|
|
{
|
|
|
|
|
day.img_select2.visible = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-04-22 11:13:16 +08:00
|
|
|
if (index == 2)
|
|
|
|
|
{
|
|
|
|
|
day.state.selectedIndex = 3;
|
|
|
|
|
for (int i = 0; i < 3; i++)
|
|
|
|
|
{
|
|
|
|
|
item_reward item = day.GetChild("item" + (i + 2)) as item_reward;
|
|
|
|
|
item.visible = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
day.state.selectedIndex = list[index].props_quantity.Length;
|
|
|
|
|
}
|
2026-04-22 09:52:55 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
setItemUrl(day.item1.loader_, GiftType.coin);
|
|
|
|
|
day.item1.lab_num.text = "x" + list[index].coins_quantity;
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < list[index].props_quantity.Length; i++)
|
|
|
|
|
{
|
|
|
|
|
item_reward item = (day.GetChild("item" + (i + 2)) as item_reward);
|
|
|
|
|
setItemUrl(item.loader_, (GiftType)list[index].props_type[i]);
|
2026-04-22 11:13:16 +08:00
|
|
|
item.visible = true;
|
2026-04-22 09:52:55 +08:00
|
|
|
item.lab_num.text = "x" + list[index].props_quantity[i];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void setItemUrl(GLoader loader, GiftType urltype)
|
|
|
|
|
{
|
|
|
|
|
if (urltype == GiftType.coin) loader.url = "ui://threeDaysGift/3DAYS_prs_001";
|
|
|
|
|
else if (urltype == GiftType.move_out) loader.url = "ui://threeDaysGift/3DAYS_prs_003";
|
|
|
|
|
else if (urltype == GiftType.refresh) loader.url = "ui://threeDaysGift/3DAYS_prs_002";
|
|
|
|
|
else if (urltype == GiftType.undo) loader.url = "ui://threeDaysGift/3DAYS_prs_004";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void getReward()
|
|
|
|
|
{
|
2026-04-22 11:13:16 +08:00
|
|
|
int index = SaveData.GetSaveObject().three_gift_got_index;
|
2026-04-22 09:52:55 +08:00
|
|
|
|
|
|
|
|
com_item item = null;
|
|
|
|
|
if (index == (int)rewardState.day1)
|
|
|
|
|
{
|
|
|
|
|
item = ui.day1;
|
|
|
|
|
}
|
|
|
|
|
else if (index == (int)rewardState.day2)
|
|
|
|
|
{
|
|
|
|
|
item = ui.day2;
|
|
|
|
|
}
|
|
|
|
|
else if (index == (int)rewardState.day3)
|
|
|
|
|
{
|
|
|
|
|
item = ui.day3;
|
|
|
|
|
}
|
|
|
|
|
item.img_select.visible = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<int> types = new List<int>();
|
|
|
|
|
List<int> rewards = new List<int>();
|
|
|
|
|
types.Add((int)GiftType.coin);
|
|
|
|
|
rewards.Add(list[index - 1].coins_quantity);
|
|
|
|
|
for (int i = 0; i < list[index - 1].props_quantity.Length; i++)
|
|
|
|
|
{
|
|
|
|
|
types.Add(list[index - 1].props_type[i]); // GiftType 类型
|
|
|
|
|
rewards.Add(list[index - 1].props_quantity[i]);
|
|
|
|
|
}
|
|
|
|
|
GiftData data = new GiftData();
|
|
|
|
|
data.type = types;
|
|
|
|
|
data.reward = rewards;
|
|
|
|
|
uiCtrlDispatcher.Dispatch(UICtrlMsg.RewardMulNewUI_Open, data);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
enum rewardState
|
|
|
|
|
{
|
|
|
|
|
day1 = 1,
|
|
|
|
|
day2,
|
|
|
|
|
day3
|
|
|
|
|
}
|
|
|
|
|
public class GiftData
|
|
|
|
|
{
|
|
|
|
|
public List<int> type;
|
|
|
|
|
public List<int> reward;
|
|
|
|
|
public string uiName;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public enum GiftType : int
|
|
|
|
|
{
|
|
|
|
|
coin = 101,
|
|
|
|
|
move_out = 0,
|
|
|
|
|
undo = 1,
|
|
|
|
|
refresh = 2,
|
2026-04-22 11:13:16 +08:00
|
|
|
}
|