ArmorTemplate - jimdroberts/FishMMO GitHub Wiki
ScriptableObject template for armor items, defining armor bonus attributes. Inherits from EquippableItemTemplate for equipment logic.
-
public ItemAttributeTemplate ArmorBonus
The attribute template representing the armor bonus provided by this item.
- Create a new ArmorTemplate asset via the Unity Editor (Assets > Create > FishMMO > Item > Armor).
- Assign an ItemAttributeTemplate to the ArmorBonus field to define the armor's bonus effect.
- Reference the ArmorTemplate in item or equipment systems as needed.
// 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
}
- 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.