mirror of
https://github.com/tym1116/BH3.git
synced 2025-12-16 08:25:20 +01:00
33 lines
782 B
C#
33 lines
782 B
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
namespace MoleMole
|
|
{
|
|
public class MonoItemIconStar : MonoBehaviour
|
|
{
|
|
private const string ITEM_STAR_PREFAB_PATH = "SpriteOutput/GeneralUI/Star";
|
|
|
|
private const string ITEM_STAR_GREY_PREFAB_PATH = "SpriteOutput/GeneralUI/StarGray";
|
|
|
|
public void SetupView(int star, int maxStar)
|
|
{
|
|
for (int i = 0; i < base.transform.childCount; i++)
|
|
{
|
|
Image component = base.transform.GetChild(i).GetComponent<Image>();
|
|
component.gameObject.SetActive(i < maxStar);
|
|
if (i < maxStar)
|
|
{
|
|
if (i < star)
|
|
{
|
|
component.sprite = Miscs.GetSpriteByPrefab("SpriteOutput/GeneralUI/Star");
|
|
}
|
|
else
|
|
{
|
|
component.sprite = Miscs.GetSpriteByPrefab("SpriteOutput/GeneralUI/StarGray");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|