Class AttributeSet
An IAttributeSet defines the list of IAttribute that a player (that has an AbilitySystemComponent) possesses.
The attributes themselves are assigned to the IAttributeSet by dragging
This will usually include IAttributes such as Health, Mana, Speed, etc.
Inheritance
Implements
Namespace: GameplayAbilitySystem.Attributes
Assembly: Assembly-CSharp-firstpass.dll
Syntax
public class AttributeSet : MonoBehaviour, IAttributeSet
Properties
| Improve this Doc View SourceAttributes
Declaration
public List<Attribute> Attributes { get; set; }
Property Value
| Type | Description |
|---|---|
| List<Attribute> |
AttributeValueChanged
Event called whenever a attribute value changes
Declaration
public AttributeChangeDataEvent AttributeValueChanged { get; }
Property Value
| Type | Description |
|---|---|
| AttributeChangeDataEvent | Event is raised with a payload of AttributeChangeDataEvent |
Methods
| Improve this Doc View SourceGetOwningAbilitySystem()
Gets the AbilitySystemComponent that owns this Attribute Set
Declaration
public AbilitySystemComponent GetOwningAbilitySystem()
Returns
| Type | Description |
|---|---|
| AbilitySystemComponent | Ability System Component which owns this IAttributeSet |
PostGameplayEffectExecute(GameplayEffect, GameplayModifierEvaluatedData)
Called after modification to attribute. This should be used to execute reactions to attribute change, such as dying when health is 0, or showing a "damaged" animation when health decreases
Declaration
public void PostGameplayEffectExecute(GameplayEffect Effect, GameplayModifierEvaluatedData EvalData)
Parameters
| Type | Name | Description |
|---|---|---|
| GameplayEffect | Effect | Effect that was executed |
| GameplayModifierEvaluatedData | EvalData | Attribute modifier |
PreAttributeBaseChange(IAttribute, ref Single)
Called before modification to the base attribute value. This should be used to enforce clamping rules (e.g.) health can't be greater than max health.
Declaration
public void PreAttributeBaseChange(IAttribute Attribute, ref float newMagnitude)
Parameters
| Type | Name | Description |
|---|---|---|
| IAttribute | Attribute | |
| System.Single | newMagnitude |
PreAttributeChange(IAttribute, ref Single)
Called before modification to the current attribute value. This should be used to enforce clamping rules (e.g.) health can't be greater than max health
Declaration
public void PreAttributeChange(IAttribute Attribute, ref float NewValue)
Parameters
| Type | Name | Description |
|---|---|---|
| IAttribute | Attribute | |
| System.Single | NewValue | New value of the attribute. This is passed as ref, so this method can modify it. |
PreGameplayEffectExecute(GameplayEffect, GameplayModifierEvaluatedData)
Decides whether this attribute change should take effect
Declaration
public bool PreGameplayEffectExecute(GameplayEffect Effect, GameplayModifierEvaluatedData EvalData)
Parameters
| Type | Name | Description |
|---|---|---|
| GameplayEffect | Effect | Effect being executed |
| GameplayModifierEvaluatedData | EvalData | Attribute modifier |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if attribute change should take effect, false otherwise |