ArmorTemplate - jimdroberts/FishMMO GitHub Wiki

Description

ScriptableObject template for armor items, defining armor bonus attributes. Inherits from EquippableItemTemplate for equipment logic.


API Access

Fields

  • public ItemAttributeTemplate ArmorBonus

    The attribute template representing the armor bonus provided by this item.


Basic Usage

Setup

  1. Create a new ArmorTemplate asset via the Unity Editor (Assets > Create > FishMMO > Item > Armor).
  2. Assign an ItemAttributeTemplate to the ArmorBonus field to define the armor's bonus effect.
  3. Reference the ArmorTemplate in item or equipment systems as needed.

Example

// Example 1: Accessing the armor bonus from a template
ArmorTemplate armor = ...; // Reference to the armor template
ItemAttributeTemplate bonus = armor.ArmorBonus;
if (bonus != null) {
    // Use the armor bonus attribute
}

Best Practices

  • Assign a relevant ItemAttributeTemplate to the ArmorBonus field for each armor item.
  • Use descriptive asset names for clarity and maintainability.
  • Document the purpose and effect of each armor bonus in the asset's Inspector description.
⚠️ **GitHub.com Fallback** ⚠️