65 lines
2.3 KiB
C#
65 lines
2.3 KiB
C#
using System.Collections.Generic;
|
|
using GameCore;
|
|
using UnityEngine;
|
|
using System.Threading.Tasks;
|
|
using UniRx;
|
|
using System;
|
|
using asap.core;
|
|
using Game;
|
|
|
|
public class SocialRushEgyptPanel : Assets.Scripts.UI.SocialRush.SocialRushMainPanel
|
|
{
|
|
[SerializeField] private Animation aniRoot;
|
|
protected override async Task Refresh(List<ItemData> rewardList)
|
|
{
|
|
int idx = 0;
|
|
var itemViewDataList = new List<SocialRushRewardItemViewData>();
|
|
while (idx < rewardList.Count)
|
|
{
|
|
itemViewDataList.Add(new SocialRushRewardItemViewData
|
|
{
|
|
Reward = rewardList[idx],
|
|
IsDone = false,
|
|
Type = idx % 2 == 0 ? SocialRushRewardItemViewType.LeftSide : SocialRushRewardItemViewType.RightSide,
|
|
DoShow = true
|
|
});
|
|
idx++;
|
|
}
|
|
if (itemViewDataList.Count > 0)
|
|
itemViewDataList[^1].Type = SocialRushRewardItemViewType.Final;
|
|
while (idx < RewardSlotCount)
|
|
{
|
|
itemViewDataList.Add(new SocialRushRewardItemViewData { DoShow = false });
|
|
idx++;
|
|
}
|
|
|
|
aniRoot.Play();
|
|
GContext.Publish(new EventUISound("audio_ui_eventsocialegypt_refresh"));
|
|
await Task.Delay(TimeSpan.FromSeconds(35f/60));
|
|
for (int i = 0; i < itemViewDataList.Count; i++)
|
|
{
|
|
socialRushRewardItemViews[i].Set(itemViewDataList[i]);
|
|
}
|
|
await Task.Delay(TimeSpan.FromSeconds(50f/60));
|
|
|
|
// for (int i = 0; i < socialRushRewardItemViews.Length - 1; i++)
|
|
// socialRushRewardItemViews[i].Hide();
|
|
|
|
// for (int i = 0; i < itemViewDataList.Count; i++)
|
|
// {
|
|
// if (itemViewDataList[i].DoShow)
|
|
// {
|
|
// GContext.Publish(new EventUISound("audio_ui_socialrush_viking_fly"));
|
|
// await FlyItem(
|
|
// flyingSocialRushReward.transform.position,
|
|
// socialRushRewardItemViews[i].transform.position,
|
|
// bezierPivot.transform.position,
|
|
// 0.5f,
|
|
// socialRushRewardItemViews[i].transform.localScale.x,
|
|
// itemViewDataList[i].Reward);
|
|
// }
|
|
// socialRushRewardItemViews[i].Set(itemViewDataList[i]);
|
|
// }
|
|
}
|
|
}
|