using System.Collections;
|
using System.Collections.Generic;
|
using UnityEngine;
|
using Snxxz.UI;
|
using System;
|
|
|
namespace EnhancedUI.EnhancedScroller
|
{
|
public class FairyBossAwardCell : CellView
|
{
|
[SerializeField] List<ItemBehaviour> m_Items;
|
[SerializeField] List<ItemStar> m_Stars;
|
public void Init(int _index, int _itemId)
|
{
|
m_Items[_index].gameObject.SetActive(_itemId != 0);
|
if (_itemId == 0)
|
{
|
return;
|
}
|
if (_index < m_Items.Count)
|
{
|
m_Items[_index].SetItem(_itemId, 1);
|
var _itemCfg = ItemConfig.Get(_itemId);
|
m_Stars[_index].SetStar(_itemCfg.StarLevel);
|
}
|
}
|
|
[Serializable]
|
public class ItemStar
|
{
|
[SerializeField] List<GameObject> m_Stars;
|
|
public void SetStar(int _starCnt)
|
{
|
for (int i = 0; i < m_Stars.Count; i++)
|
{
|
m_Stars[i].SetActive(i < _starCnt);
|
}
|
}
|
}
|
}
|
}
|