StatsAndEffects.RemoveEffect
Declaration#
public virtual bool RemoveEffect(string statusEffectId, bool allInstances)Parameters#
| Name | Description |
|---|---|
| statusEffectId | Id of Status Effect to remove. |
| allInstances | If true all instance of effects with the supplied id are removed, otherwise only the 1st instance is removed. |
Description#
Removes an effect from the object by id.
Usage#
Example
using NullSave.GDTK.Stats;using UnityEngine;
public class Example : MonoBehaviour{
public void ExampleMethod(StatsAndEffects source) { string id = source.database.effects[0].info.id; source.RemoveEffect(id, true); }
}Declaration#
public virtual bool RemoveEffect(GDTKStatusEffect statusEffect)Parameters#
| Name | Description |
|---|---|
| statusEffect | Status Effect to remove. |
Description#
Removes a specific instance of an Status Effect from the object.
Usage#
Example
using NullSave.GDTK.Stats;using UnityEngine;
public class Example : MonoBehaviour{
public void ExampleMethod(StatsAndEffects source) { foreach(GDTKStatusEffect effect in source.activeEffects) { source.RemoveEffect(effect); } }
}