You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.1 KiB
42 lines
1.1 KiB
using TMPro;
|
|
using UnityEngine;
|
|
|
|
public class ObjectIndicator : MonoBehaviour
|
|
{
|
|
[SerializeField] ExtendImage iconImage;
|
|
public ExtendImage IconImage => iconImage;
|
|
|
|
[SerializeField] RectTransform[] starImages;
|
|
|
|
[SerializeField] ExtendImage gradeBGImage;
|
|
public ExtendImage GradeBGImage => gradeBGImage;
|
|
|
|
[SerializeField] ExtendImage gradeLetterImage;
|
|
public ExtendImage GradeLetterImage => gradeLetterImage;
|
|
|
|
[SerializeField] TextMeshProUGUI countText;
|
|
public TextMeshProUGUI CountText => countText;
|
|
|
|
[SerializeField] TextMeshProUGUI levelText;
|
|
[SerializeField] bool isShowLevelText = true;
|
|
|
|
public void SetStar(int starCount)
|
|
{
|
|
for (int i = 0; i < starImages.Length; ++i)
|
|
starImages[i].gameObject.SetActive(i < starCount);
|
|
}
|
|
|
|
public void SetLevelText(uint level)
|
|
{
|
|
if (isShowLevelText)
|
|
{
|
|
levelText.text = FormatString.StringFormat("Lv. {0}", level);
|
|
levelText.gameObject.SetActive(true);
|
|
}
|
|
else
|
|
{
|
|
levelText.text = string.Empty;
|
|
levelText.gameObject.SetActive(false);
|
|
}
|
|
}
|
|
}
|