BaseAbilityTemplate - jimdroberts/FishMMO GitHub Wiki
Abstract base ScriptableObject for ability templates, providing common fields and tooltip logic. Used as the foundation for all ability templates in the FishMMO system, supporting configuration of icons, descriptions, requirements, and UI integration.
-
public Sprite icon
The icon representing the ability.
-
public string Description
Description of the ability.
-
public float ActivationTime
Time required to activate the ability.
-
public float LifeTime
Lifetime of the ability effect.
-
public float Speed
Speed of the ability effect.
-
public float Cooldown
Cooldown time for the ability.
-
public int Price
Price or cost of the ability.
-
public AbilityResourceDictionary Resources
Resources required to use the ability.
-
public AbilityResourceDictionary RequiredAttributes
Attributes required to use the ability.
-
public FactionTemplate RequiredFaction
Faction required to use the ability.
-
public ArchetypeTemplate RequiredArchetype
Archetype required to use the ability.
-
public string Name
The name of the ability (from the ScriptableObject name).
-
public Sprite Icon
The icon representing the ability (property accessor).
-
public virtual string Tooltip()
Returns the tooltip string for the ability. Returns:
- string: The tooltip string for the ability.
-
public virtual string Tooltip(List combineList)
Returns the tooltip string for the ability, optionally combining with other tooltips. Parameters:
- List combineList: List of tooltips to combine. Returns:
- string: The tooltip string for the ability.
-
public virtual string GetFormattedDescription()
Returns the formatted description for the ability. Returns:
- string: The formatted description for the ability.
- Inherit from
BaseAbilityTemplate
to define a new ability template type. - Configure fields such as icon, description, activation time, lifetime, speed, cooldown, price, and requirements in the Unity Inspector or via script.
- Integrate with the ability system to use the template for ability instantiation and logic.
- Use the tooltip methods to display ability information in the UI.
// Example 1: Creating a Custom Ability Template
// This example demonstrates how to create a new ability template by inheriting from BaseAbilityTemplate.
// Configure the template's properties and override methods as needed for custom logic.
[CreateAssetMenu(menuName = "FishMMO/Character/Ability/CustomAbility")]
public class CustomAbilityTemplate : BaseAbilityTemplate
{
// Add custom logic or override base methods here.
}