Show / Hide Table of Contents

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 of type IAttribute to the IAttributeSet in the Unity Inspector.

This will usually include IAttributes such as Health, Mana, Speed, etc.

Inheritance
System.Object
AttributeSet
Implements
IAttributeSet
Namespace: GameplayAbilitySystem.Attributes
Assembly: Assembly-CSharp-firstpass.dll
Syntax
public class AttributeSet : MonoBehaviour, IAttributeSet

Properties

| Improve this Doc View Source

Attributes

Declaration
public List<Attribute> Attributes { get; set; }
Property Value
Type Description
List<Attribute>
| Improve this Doc View Source

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 Source

GetOwningAbilitySystem()

Gets the AbilitySystemComponent that owns this Attribute Set

Declaration
public AbilitySystemComponent GetOwningAbilitySystem()
Returns
Type Description
AbilitySystemComponent

Ability System Component which owns this IAttributeSet

| Improve this Doc View Source

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

| Improve this Doc View Source

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
| Improve this Doc View Source

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.

| Improve this Doc View Source

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

Implements

IAttributeSet
  • Improve this Doc
  • View Source
Back to top Generated by DocFX