32 lines
753 B
C#
32 lines
753 B
C#
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class StarPieceHud : MonoBehaviour
|
|
{
|
|
[SerializeField] private Image[] _imageArray;
|
|
[SerializeField] private TMP_Text _countText;
|
|
|
|
[SerializeField] private GameObject _StarPieceUIRoot;
|
|
|
|
public int GetStarCount => CollectionManager.Instance.GetStarCount;
|
|
|
|
public void RefreshUI()
|
|
{
|
|
_countText.text = $"{GetStarCount} / {_imageArray.Length}";
|
|
|
|
for(int i = 0; i<_imageArray.Length; i++)
|
|
{
|
|
if(i < GetStarCount)
|
|
{
|
|
_imageArray[i].gameObject.SetActive(true);
|
|
}
|
|
}
|
|
}
|
|
|
|
public void StarPieceHudToggle()
|
|
{
|
|
_StarPieceUIRoot.SetActive(!_StarPieceUIRoot.activeSelf);
|
|
}
|
|
}
|