Skip to content

Class: EntityAbility ​

csharp
[HideMonoScript]
public class EntityAbility : EntityComponent, ILogicUpdate, ICleanup

Fields ​

NameDeclarationDescription
abilityPresetpublic AssetRef<AbilityTrigger>[] abilityPreset
AttackAbilityIndexpublic const int AttackAbilityIndex = 63
attackAbilityPresetpublic AssetRef<AttackTrigger> attackAbilityPreset
ClientEvent_OnAbilityAddedpublic SafeAction<int, AbilityTrigger> ClientEvent_OnAbilityAdded
ClientEvent_OnAbilityRemovedpublic SafeAction<int, AbilityTrigger> ClientEvent_OnAbilityRemoved

Properties ​

NameDeclarationDescription
abilitiespublic IReadOnlyDictionary<int, AbilityTrigger> abilities { get; }
attackAbilitypublic AbilityTrigger attackAbility { get; }
originalAttackAbilitypublic AttackTrigger originalAttackAbility { get; }
overridenAttackAbilitypublic AbilityTrigger overridenAttackAbility { get; }

Methods ​

AddAbility(AbilityTrigger) ​

Add an ability to this entity. It will be equipped on empty index between 0 and 127.

csharp
public void AddAbility(AbilityTrigger trigger)

Parameters:

NameTypeDescription
triggerAbilityTrigger

AddAbility<T>() ​

Add an ability to this entity. It will be equipped on empty index between 0 and 127.

csharp
public T AddAbility<T>() where T : AbilityTrigger

Parameters:

NameTypeDescription
``T

Returns: T

Awake() ​

csharp
protected override void Awake()

GetAbility&lt;T&gt;() ​

Get this entity's first ability of the given type. Can be null.

csharp
public T GetAbility<T>() where T : AbilityTrigger

Parameters:

NameTypeDescription
``T

Returns: T

GetNewAbilityLockHandle(bool) ​

csharp
public AbilityLockHandle GetNewAbilityLockHandle(bool shouldShowLockIcon = false)

Parameters:

NameTypeDescription
shouldShowLockIconbool

Returns: AbilityLockHandle

IsAbilityCastLocked(int) ​

Is an ability locked by AbilityLockHandle? Available everywhere.

csharp
public bool IsAbilityCastLocked(int index)

Parameters:

NameTypeDescription
indexint

Returns: bool

IsAbilityEditLocked(int) ​

csharp
public bool IsAbilityEditLocked(int index)

Parameters:

NameTypeDescription
indexint

Returns: bool

IsAttackAbilityLocked(int) ​

csharp
public bool IsAttackAbilityLocked(int index)

Parameters:

NameTypeDescription
indexint

Returns: bool

LogicUpdate(float) ​

csharp
public override void LogicUpdate(float dt)

Parameters:

NameTypeDescription
dtfloat

OnStartClient() ​

csharp
public override void OnStartClient()

OnStartServer() ​

csharp
public override void OnStartServer()

RemoveAbility(int) ​

csharp
public AbilityTrigger RemoveAbility(int index)

Parameters:

NameTypeDescription
indexint

Returns: AbilityTrigger

RemoveAttackAbility() ​

Remove previous attack ability from this entity.

csharp
public AbilityTrigger RemoveAttackAbility()

Returns: AbilityTrigger

SetAbility(int, AbilityTrigger) ​

Give this entity a new ability at the given index. Previously equipped ability will be unequipped.

csharp
public void SetAbility(int index, AbilityTrigger trigger)

Parameters:

NameTypeDescription
indexint
triggerAbilityTrigger

SetAttackAbility(AttackTrigger) ​

Give a new attack ability to this entity. Previous one will be unequipped.

csharp
public void SetAttackAbility(AttackTrigger trigger)

Parameters:

NameTypeDescription
triggerAttackTrigger

ShouldShowAbilityLockIcon(int) ​

csharp
public bool ShouldShowAbilityLockIcon(int index)

Parameters:

NameTypeDescription
indexint

Returns: bool

TryGetAbility&lt;T&gt;(out T) ​

csharp
public bool TryGetAbility<T>(out T trigger) where T : AbilityTrigger

Parameters:

NameTypeDescription
triggerT
``T

Returns: bool

Maintained by the Shape of Dreams Modding Community