using asap.core; using GameCore; using System.Collections.Generic; using UnityEngine; public class ItemRewardBase : MonoBehaviour { protected List rewardItemNews = new List(); int count = 0; public void Play() { for (int i = 0; i < count; i++) { rewardItemNews[i].PlayRewardFly(); } } protected void SetItemData(List 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); } } } } }