Skip to content

Game.Prefabs.ModifierValueMode

Assembly: Assembly-CSharp
Namespace: Game.Prefabs

Type: enum

Base: System.Enum

Summary:
Represents how a modifier's numeric value should be interpreted when applied to a target value. Use this enum to control whether a modifier is applied as an absolute override, as an amount relative to the existing value, or as a relative inverse (useful for effects that scale oppositely to the base value).


Fields

  • Relative
    Value is treated as a delta added to (or multiplied against, depending on implementation) the existing/base value. Use when the modifier should change the base value by a relative amount.

  • Absolute
    Value is treated as a direct override — it replaces the existing/base value with the modifier's value.

  • InverseRelative
    Value is applied in an inverse relative manner (e.g., a larger modifier results in a smaller final effect compared to the base). Useful for effects that should scale oppositely to the base value (for example, converting a "speed" modifier into a reduction effect).

Properties

  • None

Constructors

  • None (standard enum backing by System.Enum)

Methods

  • None

Usage Example

// Example usage: apply modifier based on mode
void ApplyModifier(ref float baseValue, float modifierValue, ModifierValueMode mode)
{
    switch (mode)
    {
        case ModifierValueMode.Relative:
            baseValue += modifierValue; // or multiply depending on your system
            break;
        case ModifierValueMode.Absolute:
            baseValue = modifierValue;
            break;
        case ModifierValueMode.InverseRelative:
            baseValue -= modifierValue; // example of inverse application
            break;
    }
}