AddStatusEffect

Declaration

public StatusEffect AddStatusEffect(StatusEffectData statusEffectData, int? stack = null)

Parameters

Name
Type
Description

statusEffectData

The data that the new StatusEffect should use.

stack

int?

Optional int count of the stacks to apply.

Returns

StatusEffect Returns the StatusEffect reference that was added to the StatusManager.

Description

Adds a new StatusEffect to the StatusManager.


Declaration

public StatusEffect AddStatusEffect(StatusEffectData statusEffectData, float duration, int? stack = null)

Parameters

Name
Type
Description

statusEffectData

The data that the new StatusEffect should use.

duration

float

How long in seconds the effect should last.

stack

int?

Optional int count of the stacks to apply.

Returns

StatusEffect Returns the StatusEffect reference that was added to the StatusManager.

Description

Adds a new StatusEffect to the StatusManager for a duration of time.


Declaration

public static StatusEffect AddStatusEffect(StatusEffectData statusEffectData, float duration, UnityEvent unityEvent, int? stack = null)

Parameters

Name
Type
Description

statusEffectData

The data that the new StatusEffect should use.

duration

float

How long in seconds the effect should last.

unityEvent

The UnityEvent to subscribe the duration decrement to.

stack

int?

Optional int count of the stacks to apply.

Returns

StatusEffect Returns the StatusEffect reference that was added to the StatusManager.

Description

Adds a new StatusEffect to the StatusManager for a duration that decrements when the referenced UnityEvent is invoked.


Declaration

public static StatusEffect AddStatusEffect(StatusEffectData statusEffectData, Func<bool> predicate, int? stack = null)

Parameters

Name
Type
Description

statusEffectData

The data that the new StatusEffect should use.

predicate

Func<bool>

When true the effect will end.

stack

int?

Optional int count of the stacks to apply.

Returns

StatusEffect Returns the StatusEffect reference that was added to the StatusManager.

Description

Adds a new StatusEffect to the StatusManager that will be removed when the predicate is true.

Last updated