Class: EntityAbility
- Namespace:
Global - Assembly:
Dew.Core.dll - Inheritance / Derived: DewNetworkBehaviour → EntityComponent
[HideMonoScript]
public class EntityAbility : EntityComponent, ILogicUpdate, ICleanupFields
| Name | Declaration | Description |
|---|---|---|
abilityPreset | public AssetRef<AbilityTrigger>[] abilityPreset | |
AttackAbilityIndex | public const int AttackAbilityIndex = 63 | |
attackAbilityPreset | public AssetRef<AttackTrigger> attackAbilityPreset | |
ClientEvent_OnAbilityAdded | public SafeAction<int, AbilityTrigger> ClientEvent_OnAbilityAdded | |
ClientEvent_OnAbilityRemoved | public SafeAction<int, AbilityTrigger> ClientEvent_OnAbilityRemoved |
Properties
| Name | Declaration | Description |
|---|---|---|
abilities | public IReadOnlyDictionary<int, AbilityTrigger> abilities { get; } | |
attackAbility | public AbilityTrigger attackAbility { get; } | |
originalAttackAbility | public AttackTrigger originalAttackAbility { get; } | |
overridenAttackAbility | public AbilityTrigger overridenAttackAbility { get; } |
Methods
AddAbility(AbilityTrigger)
Add an ability to this entity. It will be equipped on empty index between 0 and 127.
public void AddAbility(AbilityTrigger trigger)Parameters:
| Name | Type | Description |
|---|---|---|
trigger | AbilityTrigger |
AddAbility<T>()
Add an ability to this entity. It will be equipped on empty index between 0 and 127.
public T AddAbility<T>() where T : AbilityTriggerParameters:
| Name | Type | Description |
|---|---|---|
| `` | T |
Returns: T
Awake()
protected override void Awake()GetAbility<T>()
Get this entity's first ability of the given type. Can be null.
public T GetAbility<T>() where T : AbilityTriggerParameters:
| Name | Type | Description |
|---|---|---|
| `` | T |
Returns: T
GetNewAbilityLockHandle(bool)
public AbilityLockHandle GetNewAbilityLockHandle(bool shouldShowLockIcon = false)Parameters:
| Name | Type | Description |
|---|---|---|
shouldShowLockIcon | bool |
Returns: AbilityLockHandle
IsAbilityCastLocked(int)
Is an ability locked by AbilityLockHandle? Available everywhere.
public bool IsAbilityCastLocked(int index)Parameters:
| Name | Type | Description |
|---|---|---|
index | int |
Returns: bool
IsAbilityEditLocked(int)
public bool IsAbilityEditLocked(int index)Parameters:
| Name | Type | Description |
|---|---|---|
index | int |
Returns: bool
IsAttackAbilityLocked(int)
public bool IsAttackAbilityLocked(int index)Parameters:
| Name | Type | Description |
|---|---|---|
index | int |
Returns: bool
LogicUpdate(float)
public override void LogicUpdate(float dt)Parameters:
| Name | Type | Description |
|---|---|---|
dt | float |
OnStartClient()
public override void OnStartClient()OnStartServer()
public override void OnStartServer()RemoveAbility(int)
public AbilityTrigger RemoveAbility(int index)Parameters:
| Name | Type | Description |
|---|---|---|
index | int |
Returns: AbilityTrigger
RemoveAttackAbility()
Remove previous attack ability from this entity.
public AbilityTrigger RemoveAttackAbility()Returns: AbilityTrigger
SetAbility(int, AbilityTrigger)
Give this entity a new ability at the given index. Previously equipped ability will be unequipped.
public void SetAbility(int index, AbilityTrigger trigger)Parameters:
| Name | Type | Description |
|---|---|---|
index | int | |
trigger | AbilityTrigger |
SetAttackAbility(AttackTrigger)
Give a new attack ability to this entity. Previous one will be unequipped.
public void SetAttackAbility(AttackTrigger trigger)Parameters:
| Name | Type | Description |
|---|---|---|
trigger | AttackTrigger |
ShouldShowAbilityLockIcon(int)
public bool ShouldShowAbilityLockIcon(int index)Parameters:
| Name | Type | Description |
|---|---|---|
index | int |
Returns: bool
TryGetAbility<T>(out T)
public bool TryGetAbility<T>(out T trigger) where T : AbilityTriggerParameters:
| Name | Type | Description |
|---|---|---|
trigger | T | |
| `` | T |
Returns: bool