43 lines
1.1 KiB
C#
43 lines
1.1 KiB
C#
using asap.core;
|
|
using GameCore;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class ItemRewardBase : MonoBehaviour
|
|
{
|
|
protected List<RewardItemNew> rewardItemNews = new List<RewardItemNew>();
|
|
int count = 0;
|
|
|
|
public void Play()
|
|
{
|
|
for (int i = 0; i < count; i++)
|
|
{
|
|
rewardItemNews[i].PlayRewardFly();
|
|
}
|
|
}
|
|
protected void SetItemData(List<ItemData> itemData)
|
|
{
|
|
if (itemData != null)
|
|
{
|
|
count = itemData.Count;
|
|
if (count > rewardItemNews.Count)
|
|
{
|
|
count = rewardItemNews.Count;
|
|
Debug.LogError($"LuckyTask Reward > PanelItem Count");
|
|
}
|
|
for (int i = 0; i < rewardItemNews.Count; i++)
|
|
{
|
|
if (count > i)
|
|
{
|
|
rewardItemNews[i].gameObject.SetActive(true);
|
|
rewardItemNews[i].SetData(itemData[i]);
|
|
}
|
|
else
|
|
{
|
|
rewardItemNews[i].gameObject.SetActive(false);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|