备份CatanBuilding瘦身独立工程
This commit is contained in:
@@ -0,0 +1,594 @@
|
||||
using asap.core;
|
||||
using DG.Tweening;
|
||||
using game;
|
||||
using Game;
|
||||
using GameCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using UniRx;
|
||||
using UnityEngine;
|
||||
|
||||
public partial class EventLuckyCardsPanel : MonoBehaviour
|
||||
{
|
||||
const string ViewPanel = "Event{0}PrizetViewPopupPanel";
|
||||
string EventPanelName = "LuckyCards";
|
||||
LuckyCardsSystem luckyCardsSystem;
|
||||
int currentMultiplier = 0;
|
||||
bool isCanClick = false;
|
||||
int ticketCount;
|
||||
private void Awake()
|
||||
{
|
||||
luckyTaskBtn = transform.Find("root/btn_task").GetComponent<LuckyTaskBtn>();
|
||||
}
|
||||
private void Start()
|
||||
{
|
||||
GContext.OnEvent<ResAddEvent>().Where(x => x.Type == 8).Subscribe(x =>
|
||||
{
|
||||
TicketAddAnim();
|
||||
}).AddTo(this);
|
||||
luckyCardsSystem = GContext.container.Resolve<LuckyCardsSystem>();
|
||||
luckyCardsSystem.Init();
|
||||
luckyTaskBtn.Init(luckyCardsSystem.model, luckyCardsSystem.model.LuckyTaskRedPointKey);
|
||||
|
||||
btnClose.onClick.AddListener(OnCloseButtonClick);
|
||||
btnTicket.onClick.AddListener(OnClickPack);
|
||||
btnInfo.onClick.AddListener(OnClickInfo);
|
||||
btnView.onClick.AddListener(OnClickView);
|
||||
btn_start.onClick.AddListener(ClickRestartGame);
|
||||
btn_reward.onClick.AddListener(OnClickReward);
|
||||
InitProgress();
|
||||
InitCardsItems();
|
||||
InitLuckyCardsPrizetSelecte();
|
||||
UpdateTimer();
|
||||
Observable.Interval(TimeSpan.FromSeconds(1f)).Subscribe(UpdateTimer).AddTo(this);
|
||||
CardRewardShowData show = luckyCardsSystem.GetWishPrizeShow();
|
||||
if (show.id == 0)
|
||||
{
|
||||
btn_select.gameObject.SetActive(true);
|
||||
wishprize.SetActive(false);
|
||||
StartGame();
|
||||
btn_start.gameObject.SetActive(true);
|
||||
multiplier.SetActive(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
btn_select.gameObject.SetActive(false);
|
||||
wishprize.SetActive(true);
|
||||
Init();
|
||||
}
|
||||
RefreshCost();
|
||||
if (currentMultiplier > 0)
|
||||
{
|
||||
multiplierNum.text = currentMultiplier.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
multiplierNum.text = "1";
|
||||
}
|
||||
npc.PlayIdle();
|
||||
GContext.container.Resolve<GuideDataCenter>().InspectTriggerGuide("EventLuckyCardsPanel");
|
||||
}
|
||||
|
||||
void RefreshCost()
|
||||
{
|
||||
ticketCount = luckyCardsSystem.TicketCount;
|
||||
int itemCost = luckyCardsSystem.config.ItemCost;
|
||||
costNum.text = ticketCount < itemCost ? $"<color=red>{itemCost}</color>" : $"<color=#13FF00>{itemCost}</color>";
|
||||
textTicketCount.text = ticketCount == 0 ? "<color=red>0</color>" : $"{ticketCount} ";
|
||||
}
|
||||
|
||||
void TicketAddAnim()
|
||||
{
|
||||
//播放跳字
|
||||
int old = ticketCount;
|
||||
ticketCount = luckyCardsSystem.TicketCount;
|
||||
int itemCost = luckyCardsSystem.config.ItemCost;
|
||||
costNum.text = ticketCount < itemCost ? $"<color=red>{itemCost}</color>" : $"<color=#13FF00>{itemCost}</color>";
|
||||
DOTween.Kill("text_ticket");
|
||||
DOTween.To(() => old, x => old = x, ticketCount, 1f).OnUpdate(() =>
|
||||
{
|
||||
textTicketCount.text = $"{old} ";
|
||||
|
||||
}).SetId("text_ticket");
|
||||
}
|
||||
|
||||
void InitProgress()
|
||||
{
|
||||
var cardsMain = luckyCardsSystem.CardsMain;
|
||||
List<int> milestoneList = cardsMain.MilestoneList;
|
||||
List<int> milestoneRewardList = cardsMain.MilestoneRewardList;
|
||||
int milestoneCount = milestoneList.Count;
|
||||
ProgressMilestone progressMilestone = luckyCardsSystem.progressMilestone;
|
||||
//计算奖励
|
||||
int newProgress = progressMilestone.progress;
|
||||
float fill = 1;
|
||||
int index = 0;
|
||||
for (int i = 0; i < milestoneCount; i++)
|
||||
{
|
||||
if (newProgress >= milestoneList[i])
|
||||
{
|
||||
index = i + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
int dropId = milestoneRewardList[i];
|
||||
var rewardData = GContext.container.Resolve<PlayerItemData>().GetItemDataOne(dropId);
|
||||
rewardItem.SetData(rewardData);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (index < milestoneCount)
|
||||
{
|
||||
int startCount = 0;
|
||||
if (index > 0)
|
||||
{
|
||||
startCount = milestoneList[index - 1];
|
||||
}
|
||||
fill = (newProgress - startCount) * 1f / (milestoneList[index] - startCount);
|
||||
text_progress.text = $"{newProgress - startCount}/{milestoneList[index] - startCount}";
|
||||
}
|
||||
else
|
||||
{
|
||||
int dropId = milestoneRewardList[milestoneCount - 1];
|
||||
var rewardData = GContext.container.Resolve<PlayerItemData>().GetItemDataOne(dropId);
|
||||
rewardItem.SetData(rewardData);
|
||||
text_progress.text = LocalizationMgr.GetText("UI_EventRankPopupPanel_15");
|
||||
}
|
||||
bar.fillAmount = fill;
|
||||
}
|
||||
|
||||
|
||||
void InitCardsItems()
|
||||
{
|
||||
for (int i = 0; i < luckyCardsItems.Count; i++)
|
||||
{
|
||||
luckyCardsItems[i].index = i;
|
||||
luckyCardsItems[i].OnClickCard = OnClickCard;
|
||||
}
|
||||
}
|
||||
|
||||
void InitLuckyCardsPrizetSelecte()
|
||||
{
|
||||
btn_select.onClick.AddListener(OpenSelect);
|
||||
btn_nextround.onClick.AddListener(OpenSelect);
|
||||
selectePanel.btn_close.onClick.AddListener(CloseSelect);
|
||||
selectePanel.btn_confrim.onClick.AddListener(OnConfirmWishPrize);
|
||||
}
|
||||
|
||||
void OpenSelect()
|
||||
{
|
||||
finger.SetActive(false);
|
||||
var itemDatas = luckyCardsSystem.GetWishPrizeReward();
|
||||
var rewardItemNews = selectePanel.rewardItemNews;
|
||||
for (int i = 0; i < rewardItemNews.Count; i++)
|
||||
{
|
||||
if (i < itemDatas.Count)
|
||||
{
|
||||
rewardItemNews[i].SetData(itemDatas[i]);
|
||||
}
|
||||
}
|
||||
selectePanel.OpenSelect();
|
||||
}
|
||||
|
||||
void OnConfirmWishPrize()
|
||||
{
|
||||
RestartGame();
|
||||
}
|
||||
|
||||
|
||||
void RestartGame()
|
||||
{
|
||||
GContext.container.Resolve<GuideDataCenter>().InspectTriggerGuide("EventLuckyCardsPanel");
|
||||
int index = selectePanel.GetSelectedIndex();
|
||||
if (index < 0)
|
||||
{
|
||||
Debug.LogWarning("[EventLucky] Selected index is out of range.");
|
||||
return;
|
||||
}
|
||||
if (luckyCardsSystem.LuckyCardsData.rewardData.Count == 0)
|
||||
{
|
||||
ani.Play("EventLuckyCards_change_2");
|
||||
|
||||
luckyCardsSystem.RefreshReward();
|
||||
}
|
||||
luckyCardsSystem.OnConfirmWishPrize(index);
|
||||
RefreshCost();
|
||||
Restart();
|
||||
CloseSelect();
|
||||
}
|
||||
|
||||
void CloseSelect()
|
||||
{
|
||||
selectePanel.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
void OnClickCard(int index)
|
||||
{
|
||||
if (!isCanClick)
|
||||
{
|
||||
if (btn_start.gameObject.activeSelf)
|
||||
{
|
||||
ClickRestartGame();
|
||||
}
|
||||
return;
|
||||
}
|
||||
ItemData itemData = luckyCardsSystem.OnClickCard(index);
|
||||
if (itemData == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
List<int> previewPos = luckyCardsSystem.LuckyCardsData.pos;
|
||||
var cardRewardShowData = luckyCardsSystem.cardRewardShowDatas;
|
||||
IEventLuckyCardItem luckyCardItem = luckyCardsItems[index];
|
||||
CardRewardShowData rewardShowData = cardRewardShowData[previewPos.Count - 1];
|
||||
rewardShowData.isHas = true;
|
||||
luckyCardItem.OpenReward(rewardShowData);
|
||||
if (rewardShowData.id == LuckyCardsSystem.ItemID)
|
||||
{
|
||||
GContext.container.Resolve<GuideDataCenter>().TriggerGuide(GroupName.LuckyCard02.ToString(), "EventLuckyCardsPanel", false);
|
||||
}
|
||||
if (rewardShowData.isWishPrize)
|
||||
{
|
||||
npc.PlayCelebrate02();
|
||||
luckyCardItem.PlayWishprize(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
luckyCardItem.PlayWishprize(false);
|
||||
}
|
||||
RefreshCost();
|
||||
Fly(rewardShowData, index);
|
||||
}
|
||||
|
||||
async void Fly(CardRewardShowData rewardShowData, int index)
|
||||
{
|
||||
clickMask.SetActive(true);
|
||||
Vector3 srcPosition = luckyCardsItems[index].GetPosition();
|
||||
ItemData itemData = new ItemData(rewardShowData.id, rewardShowData.num);
|
||||
await Awaiters.Seconds(0.5f);
|
||||
if (rewardShowData.isWishPrize)
|
||||
{
|
||||
//先飞上面,再飞下面
|
||||
if (currentMultiplier > 0)
|
||||
{
|
||||
if (rewardShowData.multiplier != currentMultiplier)
|
||||
{
|
||||
Debug.Log($"[EventLuckyCards] Multiplier mismatch: {rewardShowData.multiplier} != {currentMultiplier}.");
|
||||
}
|
||||
itemData.count *= currentMultiplier;
|
||||
}
|
||||
currentMultiplier = 0;
|
||||
multiplierNum.text = "1";
|
||||
await FlyMultiplierFx(srcPosition, wishprize_fly, wishprize_light, multiplier_fly_time);
|
||||
wishprizeReward.text_num.text = $"x{ConvertTools.GetNumberString(itemData.count)}";
|
||||
ani.Play("EventLuckyCards_change_1");
|
||||
|
||||
await Awaiters.Seconds(1);
|
||||
Vector3 destPosition = wishprizeReward.transform.position;
|
||||
await FlyToPack(destPosition, itemData);
|
||||
wishprize_light.gameObject.SetActive(false);
|
||||
}
|
||||
else if (rewardShowData.id == LuckyCardsSystem.ItemID)
|
||||
{
|
||||
//倍率
|
||||
currentMultiplier += rewardShowData.num;
|
||||
//动画
|
||||
await FlyMultiplierFx(srcPosition, multiplier_fly, multiplier_light, multiplier_fly_time);
|
||||
multiplierNum.text = currentMultiplier.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
//飞到背包
|
||||
if (currentMultiplier > 0)
|
||||
{
|
||||
if (rewardShowData.multiplier != currentMultiplier)
|
||||
{
|
||||
Debug.Log($"[EventLuckyCards] Multiplier mismatch: {rewardShowData.multiplier} != {currentMultiplier}.");
|
||||
}
|
||||
itemData.count *= currentMultiplier;
|
||||
currentMultiplier = 0;
|
||||
multiplierNum.text = "1";
|
||||
await Awaiters.Seconds(1f);
|
||||
}
|
||||
await FlyToPack(srcPosition, itemData);
|
||||
}
|
||||
//进度奖励动画
|
||||
await PlayProgress();
|
||||
multiplier_light.SetActive(false);
|
||||
clickMask.SetActive(false);
|
||||
}
|
||||
|
||||
async Task FlyMultiplierFx(Vector3 srcPosition, GameObject fly, GameObject light, float duration)
|
||||
{
|
||||
fly.transform.position = srcPosition;
|
||||
fly.SetActive(true);
|
||||
|
||||
fly.transform.DOMove(light.transform.position, duration)
|
||||
.OnComplete(() =>
|
||||
{
|
||||
fly.SetActive(false);
|
||||
light.SetActive(true);
|
||||
});
|
||||
await Awaiters.Seconds(duration + 0.2f);
|
||||
}
|
||||
|
||||
async Task PlayProgress()
|
||||
{
|
||||
ProgressMilestone progressMilestone = luckyCardsSystem.progressMilestone;
|
||||
if (progressMilestone.oldProgress == progressMilestone.progress)
|
||||
{
|
||||
return;
|
||||
}
|
||||
luckyCardsSystem.progressMilestone.oldProgress = progressMilestone.progress;
|
||||
var cardsMain = luckyCardsSystem.CardsMain;
|
||||
List<int> milestoneList = cardsMain.MilestoneList;
|
||||
List<int> milestoneRewardList = cardsMain.MilestoneRewardList;
|
||||
int milestoneCount = milestoneList.Count;
|
||||
//计算奖励
|
||||
int newProgress = progressMilestone.progress;
|
||||
int index = 0;
|
||||
if (progressMilestone.rewardIndex != null && progressMilestone.rewardIndex.Count > 0)
|
||||
{
|
||||
for (int i = 0; i < progressMilestone.rewardIndex.Count; i++)
|
||||
{
|
||||
index = progressMilestone.rewardIndex[i];
|
||||
if (index >= 0)
|
||||
{
|
||||
//==========飞奖励===========
|
||||
int dropId = milestoneRewardList[index];
|
||||
var rewardData = GContext.container.Resolve<PlayerItemData>().GetItemDataOne(dropId);
|
||||
rewardItem.SetData(rewardData);
|
||||
int startCount = 0;
|
||||
if (index > 0)
|
||||
startCount = milestoneList[index - 1];
|
||||
int maxPro = milestoneList[index] - startCount;
|
||||
bar.DOFillAmount(1, 0.5f)
|
||||
.OnUpdate(() =>
|
||||
{
|
||||
text_progress.text = $"{(int)(maxPro * bar.fillAmount)}/{maxPro}";
|
||||
})
|
||||
.OnComplete(() =>
|
||||
{
|
||||
text_progress.text = $"{maxPro}/{maxPro}";
|
||||
})
|
||||
;
|
||||
await Awaiters.Seconds(0.5f);
|
||||
await FlyToPack(rewardItem.transform.position, rewardData);
|
||||
//===========飞奖励==========
|
||||
bar.fillAmount = 0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
index = 0;
|
||||
for (int i = 0; i < milestoneCount; i++)
|
||||
{
|
||||
if (newProgress >= milestoneList[i])
|
||||
{
|
||||
index = i + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
int dropId = milestoneRewardList[i];
|
||||
var rewardData = GContext.container.Resolve<PlayerItemData>().GetItemDataOne(dropId);
|
||||
rewardItem.SetData(rewardData);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (index < milestoneCount)
|
||||
{
|
||||
int startCount = 0;
|
||||
if (index > 0)
|
||||
startCount = milestoneList[index - 1];
|
||||
int curProgress = newProgress - startCount;
|
||||
int maxPro = milestoneList[index] - startCount;
|
||||
float fill = curProgress * 1f / maxPro;
|
||||
bar.DOFillAmount(fill, 0.3f).OnUpdate(() =>
|
||||
{
|
||||
text_progress.text = $"{(int)(maxPro * bar.fillAmount)}/{maxPro}";
|
||||
})
|
||||
.OnComplete(() =>
|
||||
{
|
||||
text_progress.text = $"{curProgress}/{maxPro}";
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
bar.fillAmount = 1f;
|
||||
text_progress.text = LocalizationMgr.GetText("UI_EventRankPopupPanel_15");
|
||||
}
|
||||
}
|
||||
|
||||
async Task FlyToPack(Vector3 srcPosition, ItemData itemData)
|
||||
{
|
||||
//var targetImg = stampRewardView.GetFirstEmptyImage();
|
||||
Vector3 destPosition = rewardStashButton.transform.position;
|
||||
float iconSize = rewardStashButton.Icon.rect.width;
|
||||
|
||||
CollectionItemFly collectionItemFly = new CollectionItemFly()
|
||||
{
|
||||
itemID = itemData.id,
|
||||
numStr = itemData.count.ToString(),
|
||||
sourcePos = srcPosition,
|
||||
destPos = destPosition,
|
||||
isPlayOpen = true,
|
||||
isPlayClose = true,
|
||||
isDestinationRewardStash = true,
|
||||
targetIconSize = iconSize
|
||||
};
|
||||
var rewardFly = Instantiate(rewardFlyPrefab, rewardFlyPrefab.transform.parent).GetComponent<RewardFly>();
|
||||
rewardFly.gameObject.SetActive(true);
|
||||
|
||||
await rewardFly.ShowAsync(collectionItemFly);
|
||||
|
||||
Destroy(rewardFly.gameObject);
|
||||
//mask.gameObject.SetActive(false);
|
||||
rewardStashButton.PlayReceiveAnimationWithDelay(0);
|
||||
}
|
||||
|
||||
private void OnClickPack()
|
||||
{
|
||||
luckyCardsSystem.OnClickPack();
|
||||
}
|
||||
|
||||
private void UpdateTimer(long _ = 0L)
|
||||
{
|
||||
textTimer.text = LocalizationMgr.GetFormatTextValue("UI_COMMON_end", ConvertTools.ConvertTime2(luckyCardsSystem.RemainingTime));
|
||||
if (luckyCardsSystem.RemainingTime.TotalSeconds <= 0)
|
||||
OnCloseButtonClick();
|
||||
}
|
||||
|
||||
void OnClickReward()
|
||||
{
|
||||
RewradPopup.SetActive(true);
|
||||
}
|
||||
|
||||
private async void OnClickInfo()
|
||||
{
|
||||
var cardsMain = luckyCardsSystem.CardsMain;
|
||||
await UIManager.Instance.ShowUINotLoading(new UIType(cardsMain.InfoPanel));
|
||||
}
|
||||
async void OnClickView()
|
||||
{
|
||||
try
|
||||
{
|
||||
GameObject popup = await UIManager.Instance.ShowUINotLoading(new UIType(string.Format(ViewPanel, EventPanelName)));
|
||||
if (popup != null)
|
||||
{
|
||||
var popupPanel = popup.GetComponent<EventLuckyCardsPrizetViewPopupPanel>();
|
||||
if (popupPanel != null)
|
||||
{
|
||||
popupPanel.btnClose.onClick.AddListener(() => UIManager.Instance.DestroyUI(string.Format(ViewPanel, EventPanelName)));
|
||||
popupPanel.btn_confrim.onClick.AddListener(() => UIManager.Instance.DestroyUI(string.Format(ViewPanel, EventPanelName)));
|
||||
|
||||
var popupItems = popupPanel.luckyCardsItems;
|
||||
List<int> previewPos = luckyCardsSystem.previewPos;
|
||||
var cardRewardShowData = luckyCardsSystem.cardRewardShowDatas;
|
||||
for (int i = 0; i < popupItems.Count; i++)
|
||||
{
|
||||
popupItems[i].ViewReward(cardRewardShowData[previewPos[i]]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogWarning($"[EventLuckyCards] Error in OnclickView: {e.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ShowWishPrize()
|
||||
{
|
||||
CardRewardShowData show = luckyCardsSystem.GetWishPrizeShow();
|
||||
wishprizeReward.SetData(new ItemData(show.id, show.num));
|
||||
}
|
||||
async void Restart()
|
||||
{
|
||||
isCanClick = false;
|
||||
clickMask.SetActive(true);
|
||||
wishprize_show_1.SetActive(true);
|
||||
ShowWishPrize();
|
||||
wishprize_show_2.SetActive(false);
|
||||
wishprize.SetActive(true);
|
||||
btn_select.gameObject.SetActive(false);
|
||||
var popupItems = luckyCardsItems;
|
||||
List<int> previewPos = luckyCardsSystem.previewPos;
|
||||
var cardRewardShowData = luckyCardsSystem.cardRewardShowDatas;
|
||||
for (int i = 0; i < popupItems.Count; i++)
|
||||
{
|
||||
popupItems[i].OpenReward(cardRewardShowData[previewPos[i]]);
|
||||
popupItems[i].PlayReward();
|
||||
}
|
||||
CardRewardShowData WishPrizeShow = luckyCardsSystem.GetWishPrizeShow();
|
||||
CardRewardShowData showData = new CardRewardShowData();
|
||||
showData.isHas = false;
|
||||
showData.isWishPrize = true;
|
||||
|
||||
popupItems[0].OpenReward(showData);
|
||||
await Awaiters.Seconds(wishprize_show);
|
||||
popupItems[0].OpenReward(WishPrizeShow);
|
||||
|
||||
wishprize_show_2.SetActive(true);
|
||||
await PlayProgress();
|
||||
clickMask.SetActive(false);
|
||||
btn_start.gameObject.SetActive(true);
|
||||
ShowStartText(true);
|
||||
wishprize_show_1.SetActive(false);
|
||||
}
|
||||
async void ClickRestartGame()
|
||||
{
|
||||
CardRewardShowData show = luckyCardsSystem.GetWishPrizeShow();
|
||||
if (show.id == 0)
|
||||
{
|
||||
finger.SetActive(true);
|
||||
return;
|
||||
}
|
||||
isCanClick = true;
|
||||
btn_start.gameObject.SetActive(false);
|
||||
ShowStartText(false);
|
||||
clickMask.SetActive(true);
|
||||
var popupItems = luckyCardsItems;
|
||||
|
||||
for (int i = 0; i < popupItems.Count; i++)
|
||||
{
|
||||
popupItems[i].PlayBack();
|
||||
}
|
||||
await Awaiters.Seconds(0.5f);
|
||||
cardAni.Play();
|
||||
mask.Play();
|
||||
await Awaiters.Seconds(3f);
|
||||
npc.PlayStart();
|
||||
clickMask.SetActive(false);
|
||||
}
|
||||
|
||||
void ShowStartText(bool value)
|
||||
{
|
||||
multiplier.SetActive(!value);
|
||||
text_start.SetActive(value);
|
||||
}
|
||||
|
||||
void StartGame()
|
||||
{
|
||||
ShowWishPrize();
|
||||
var popupItems = luckyCardsItems;
|
||||
List<int> previewPos = luckyCardsSystem.previewPos;
|
||||
var cardRewardShowData = luckyCardsSystem.cardRewardShowDatas;
|
||||
for (int i = 0; i < popupItems.Count; i++)
|
||||
{
|
||||
popupItems[i].OpenReward(cardRewardShowData[previewPos[i]]);
|
||||
popupItems[i].PlayReward();
|
||||
}
|
||||
isCanClick = false;
|
||||
}
|
||||
|
||||
private void Init()
|
||||
{
|
||||
ShowWishPrize();
|
||||
var popupItems = luckyCardsItems;
|
||||
List<int> clickPos = luckyCardsSystem.LuckyCardsData.pos;
|
||||
List<CardRewardShowData> cardRewardShowData = luckyCardsSystem.cardRewardShowDatas;
|
||||
IEventLuckyCardItem luckyCardItem = null;
|
||||
for (int i = 0; i < clickPos.Count; i++)
|
||||
{
|
||||
CardRewardShowData cardRewardShow = cardRewardShowData[i];
|
||||
luckyCardItem = popupItems[clickPos[i]];
|
||||
luckyCardItem.OpenReward(cardRewardShow);
|
||||
if (cardRewardShow.id == LuckyCardsSystem.ItemID)
|
||||
{
|
||||
currentMultiplier += cardRewardShow.num;
|
||||
}
|
||||
else
|
||||
{
|
||||
currentMultiplier = 0;
|
||||
}
|
||||
luckyCardItem.PlayReward();
|
||||
}
|
||||
isCanClick = true;
|
||||
}
|
||||
|
||||
private void OnCloseButtonClick()
|
||||
{
|
||||
GContext.Publish(new UnloadActToNextAct());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user