AddStatusEffect
Declaration
public static StatusEffect AddStatusEffect(StatusEffectData statusEffectData, int? stack = null)
Parameters
statusEffectData
stack
Option int count of the stacks to apply.
Returns
StatusEffect Returns the StatusEffect reference that was added to the MonoBehaviour.
Description
Adds a new StatusEffect to a given MonoBehaviour.
Declaration
public static StatusEffect AddStatusEffect(StatusEffectData statusEffectData, float duration, int? stack = null)
Parameters
statusEffectData
duration
How long in seconds the effect should last.
stack
Option int count of the stacks to apply.
Returns
StatusEffect Returns the StatusEffect reference that was added to the MonoBehaviour.
Description
Adds a new StatusEffect to a given MonoBehaviour for a duration of time.
Declaration
public static StatusEffect AddStatusEffect(StatusEffectData statusEffectData, float duration, UnityEvent unityEvent, int? stack = null)
Parameters
statusEffectData
duration
How long in seconds the effect should last.
unityEvent
stack
Option int count of the stacks to apply.
Returns
StatusEffect Returns the StatusEffect reference that was added to the MonoBehaviour.
Description
Adds a new StatusEffect to a given MonoBehaviour 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
statusEffectData
predicate
When true the effect will end.
stack
Option int count of the stacks to apply.
Returns
StatusEffect Returns the StatusEffect reference that was added to the MonoBehaviour.
Description
Adds a new StatusEffect to a given MonoBehaviour that will be removed when the predicate is true.