Skip to main content

StatsAndEffects.RemoveEffect

Declaration#

public virtual bool RemoveEffect(string statusEffectId, bool allInstances)

Parameters#

NameDescription
statusEffectIdId of Status Effect to remove.
allInstancesIf 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#

NameDescription
statusEffectStatus 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);        }    }
}