AchievementTemplate - jimdroberts/FishMMO GitHub Wiki
ScriptableObject template representing an achievement, including icon, category, description, and tiers. Used to define achievements in FishMMO, providing data for UI display and achievement tracking.
-
public Sprite Icon
The icon representing this achievement in the UI.
-
public AchievementCategory Category
The category this achievement belongs to (e.g., Combat, Exploration).
-
public string Description
The description of the achievement, shown to the player.
-
public List Tiers
The list of tiers for this achievement, each representing a milestone or level.
-
public string Name
The name of this achievement template (from the ScriptableObject's name).
- Create a new
AchievementTemplate
asset via the Unity Editor (right-click in Project window > Create > FishMMO > Character > Achievement > Achievement). - Assign an icon, category, description, and define tiers in the Inspector.
- Reference the
AchievementTemplate
in your achievement or progression systems as needed. - No additional configuration is required; the template is ready for use after setup.
// Example 1: Accessing achievement data from a template
AchievementTemplate achievement = ...; // Reference to the asset
string desc = achievement.Description;
Sprite icon = achievement.Icon;
// Example 2: Iterating through achievement tiers
foreach (var tier in achievement.Tiers)
{
// Process each tier (e.g., check progress, display info)
}
- Use descriptive names and categories for achievements to improve player clarity.
- Group related achievements using the Category field for easier management and UI organization.
- Define clear, incremental tiers to encourage player progression.
- Keep descriptions concise and informative for better user experience.