OverridableAttribute

Field-level attribute that marks a FactorableData field as eligible for override by the variant system. Extends OdinSerializeAttribute to ensure the marked field is also Odin-serialized.

Definition

Namespace: Paragon.Core.ScriptableFactory Assembly: Paragon.dll

[AttributeUsage(AttributeTargets.Field)]
public class OverridableAttribute : OdinSerializeAttribute

Inherits: Sirenix.Serialization.OdinSerializeAttribute

Remarks

This attribute serves a dual purpose:

  1. Variant eligibilityDataOverride.CanOverrideField() checks for this attribute via reflection. Fields without [Overridable] are rejected when adding field overrides.

  2. Odin serialization — Inheriting from OdinSerializeAttribute ensures marked fields are serialized by Odin, even if they would not be serialized by Unity's default serializer.

An optional OverriderType parameter allows specifying a custom DataFieldOverride subclass for fields that need specialized override logic (e.g., list merging, conditional application).

Quick Lookup

Goal
How

Mark a field as overridable

[Overridable] public float health;

Use a custom overrider

[Overridable(typeof(MyCustomOverride))] public List<Item> items;

Check if a field is overridable

DataOverride.CanOverrideField(fieldName)

Properties

OverriderType

Optional custom DataFieldOverride subclass type used instead of the default DataFieldOverride<TField>.

When null (default), the system auto-creates DataFieldOverride<TField> using the field's type. When set, the system creates an instance of the specified type instead.

Constructor

Parameter
Type
Description

overriderType

Type

Custom DataFieldOverride subclass type, or null for default behavior

Usage Examples

Basic usage

Custom overrider type

Common Pitfalls

circle-exclamation
circle-exclamation

See Also

Last updated