Show / Hide Table of Contents

Class AbilitySystemComponent

The IGameplayAbilitySystem is the primary component of the Gameplay Ability System. Every component that needs to participate with the Ability System (such as receiving or dealing damage) needs to have this component.

Inheritance
System.Object
AbilitySystemComponent
Implements
IGameplayAbilitySystem
Namespace: GameplayAbilitySystem
Assembly: Assembly-CSharp-firstpass.dll
Syntax
public class AbilitySystemComponent : MonoBehaviour, IGameplayAbilitySystem

Fields

| Improve this Doc View Source

_activeGameplayEffects

Declaration
protected List<ActiveGameplayEffectData> _activeGameplayEffects
Field Value
Type Description
List<ActiveGameplayEffectData>
| Improve this Doc View Source

_runningAbilities

Declaration
protected List<IGameplayAbility> _runningAbilities
Field Value
Type Description
List<IGameplayAbility>

Properties

| Improve this Doc View Source

ActiveGameplayEffects

Lists all active GameplayEffect on this IGameplayAbilitySystem

Declaration
public List<ActiveGameplayEffectData> ActiveGameplayEffects { get; }
Property Value
Type Description
List<ActiveGameplayEffectData>
| Improve this Doc View Source

OnGameplayAbilityActivated

Called when a IGameplayAbility is activated on this IGameplayAbilitySystem. Activation may or may not result in the ability actually running.

Declaration
public GenericAbilityEvent OnGameplayAbilityActivated { get; }
Property Value
Type Description
GenericAbilityEvent
| Improve this Doc View Source

OnGameplayAbilityCommitted

Called when a IGameplayAbility is committed on this IGameplayAbilitySystem. This indicates that the resource/cooldown for the ability have been commited and the ability will be executed

Declaration
public GenericAbilityEvent OnGameplayAbilityCommitted { get; }
Property Value
Type Description
GenericAbilityEvent
| Improve this Doc View Source

OnGameplayAbilityEnded

Called when a IGameplayAbility ends IGameplayAbilitySystem (e.g. EndAbility(IGameplayAbilitySystem) is called) This indicates that the resource/cooldown for the ability have been commited and the ability will be executed

Declaration
public GenericAbilityEvent OnGameplayAbilityEnded { get; }
Property Value
Type Description
GenericAbilityEvent
| Improve this Doc View Source

OnGameplayEvent

This event is called when a GameplayEvent is executed this IGameplayAbilitySystem

Declaration
public GameplayEvent OnGameplayEvent { get; }
Property Value
Type Description
GameplayEvent
| Improve this Doc View Source

RunningAbilities

List of running abilities that have not ended on this IGameplayAbilitySystem

Declaration
public List<IGameplayAbility> RunningAbilities { get; }
Property Value
Type Description
List<IGameplayAbility>

Methods

| Improve this Doc View Source

AddGameplayEffectToActiveList(GameplayEffect)

Applies a GameplayEffect to this IGameplayAbilitySystem

Declaration
public void AddGameplayEffectToActiveList(GameplayEffect Effect)
Parameters
Type Name Description
GameplayEffect Effect

Effect to be applied

| Improve this Doc View Source

ApplyGameEffectToTarget(GameplayEffect, IGameplayAbilitySystem, Single)

Applies a GameplayEffect to the target IGameplayAbilitySystem. The overall effect may be modulated by the Level.

Declaration
public GameplayEffect ApplyGameEffectToTarget(GameplayEffect Effect, IGameplayAbilitySystem Target, float Level = null)
Parameters
Type Name Description
GameplayEffect Effect

Effect to be applied

IGameplayAbilitySystem Target

Target on which effect is to be applied

System.Single Level

Level of the effect. May be used to affect the "strength" of the effect

Returns
Type Description
GameplayEffect

GameplayEffect that was applied to the target

| Improve this Doc View Source

CanActivateAbility(GameplayAbility)

Checks to see if the GameplayAbility can be activated on this component. Does not execute the ability.

Declaration
public bool CanActivateAbility(GameplayAbility Ability)
Parameters
Type Name Description
GameplayAbility Ability

The GameplayAbility to execute

Returns
Type Description
System.Boolean

True if the ability can be activated, false otherwise

| Improve this Doc View Source

GetActor()

Gets the parent of this IGameplayAbilitySystem

Declaration
public Transform GetActor()
Returns
Type Description
Transform
| Improve this Doc View Source

GetNumericAttribute(AttributeType)

Gets the numerical value of an attribute attached to this

Declaration
public float GetNumericAttribute(AttributeType AttributeType)
Parameters
Type Name Description
AttributeType AttributeType

Type of attribute to get value of

Returns
Type Description
System.Single

Current value of attribute

| Improve this Doc View Source

HandleGameplayEvent(GameplayTag, GameplayEventData)

Responds to a Gameplay Event on this IGameplayAbilitySystem

Declaration
public void HandleGameplayEvent(GameplayTag EventTag, GameplayEventData Payload)
Parameters
Type Name Description
GameplayTag EventTag

Tag of the event

GameplayEventData Payload

Payload containing information about the event, such as target, etc.

| Improve this Doc View Source

NotifyAbilityEnded(GameplayAbility)

Notifies this IGameplayAbilitySystem that the specified GameplayAbility has ended

Declaration
public void NotifyAbilityEnded(GameplayAbility ability)
Parameters
Type Name Description
GameplayAbility ability
| Improve this Doc View Source

TryActivateAbility(GameplayAbility)

Attempts to activate the GameplayAbility.

Declaration
public bool TryActivateAbility(GameplayAbility Ability)
Parameters
Type Name Description
GameplayAbility Ability

The GameplayAbility to execute

Returns
Type Description
System.Boolean

True if the ability was activated, false otherwise

| Improve this Doc View Source

UpdateCooldowns()

Declaration
protected void UpdateCooldowns()

Implements

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