UIAchievementDescription - jimdroberts/FishMMO GitHub Wiki
A UI component for displaying the details of an achievement in the FishMMO client. Shows the achievement icon, description, progress, and value. Intended to be used as part of the achievements UI to provide detailed information about a selected achievement.
-
public Image Image
The image representing the achievement icon.
-
public TMP_Text Label
The label displaying the achievement description.
-
public Slider Progress
The slider showing the achievement progress.
-
public TMP_Text Value
The text displaying the current and maximum achievement value.
- Attach
UIAchievementDescription
to an achievement description UI GameObject in the Unity Editor. - Assign the
Image
,Label
,Progress
, andValue
fields in the Inspector. - Integrate with the achievements UI to update the details when an achievement is selected.
// Example usage in a MonoBehaviour
public UIAchievementDescription achievementDescription;
void ShowAchievement(Achievement achievement) {
achievementDescription.Image.sprite = achievement.Icon;
achievementDescription.Label.text = achievement.Description;
achievementDescription.Progress.value = achievement.Progress;
achievementDescription.Value.text = $"{achievement.Current}/{achievement.Max}";
}
- Always assign all UI references in the Inspector to avoid null reference errors.
- Update the UI fields whenever a new achievement is selected.
- Use the progress slider and value text to give clear feedback on achievement completion.