49 lines
1.1 KiB
C#
49 lines
1.1 KiB
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class uAchievementPrefab : MonoBehaviour
|
|
{
|
|
[Header("infos")]
|
|
public Image aBottomImage;
|
|
public Image aIcon;
|
|
public Text aName;
|
|
public Text aGetDate;
|
|
public Text aDescription;
|
|
|
|
public void Setup(GlobalAchievementSnapshot snapshot, Sprite bottomSprite)
|
|
{
|
|
GlobalAchievementSO definition = snapshot.definition;
|
|
if (definition == null)
|
|
{
|
|
return;
|
|
}
|
|
|
|
if (aName != null)
|
|
{
|
|
aName.text = definition.displayName;
|
|
}
|
|
|
|
if (aGetDate != null)
|
|
{
|
|
aGetDate.text = snapshot.unlockedDateTimeText;
|
|
}
|
|
|
|
if (aDescription != null)
|
|
{
|
|
aDescription.text = definition.description;
|
|
}
|
|
|
|
if (aIcon != null)
|
|
{
|
|
aIcon.sprite = definition.icon;
|
|
aIcon.enabled = definition.icon != null;
|
|
}
|
|
|
|
if (aBottomImage != null)
|
|
{
|
|
aBottomImage.sprite = bottomSprite;
|
|
aBottomImage.enabled = bottomSprite != null;
|
|
}
|
|
}
|
|
}
|