AchievementTemplate - jimdroberts/FishMMO GitHub Wiki

Description

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.


API Access

Fields

  • 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.

Properties

  • public string Name

    The name of this achievement template (from the ScriptableObject's name).

Methods


Basic Usage

Setup

  1. Create a new AchievementTemplate asset via the Unity Editor (right-click in Project window > Create > FishMMO > Character > Achievement > Achievement).
  2. Assign an icon, category, description, and define tiers in the Inspector.
  3. Reference the AchievementTemplate in your achievement or progression systems as needed.
  4. No additional configuration is required; the template is ready for use after setup.

Example

// 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)
}

Best Practices

  • 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.
⚠️ **GitHub.com Fallback** ⚠️