Generated C# types
Every field becomes a property on the class for its object type. Here's the type each one gets. The settings for Colour fields are on the Unity settings page.

Names
- Classes are named for the object type, in PascalCase.
melee-weaponbecomesMeleeWeapon. - Properties are named for the field's key in PascalCase.
attack_speedbecomesAttackSpeed. - Methods from runtime formulas are named for the formula's key. Their parameters are in camelCase.
- Characters that can't appear in a C# name are dropped. A name that starts with a digit gets an underscore in front.
Single values
| Field type | C# type | When the field is required |
|---|---|---|
| Text | string? | string |
| Number | float? | float |
| Boolean | bool? | bool |
| Date | DateTime? | DateTime |
| Enum | The enum's type, nullable | The enum's type |
| Reference | The target's class, nullable. The record is loaded when you read the property | Still nullable |
| Colour | string? holding the colour as text, or Color? with Unity types | string, or Color with Unity types |
| Formula | float? | Not applicable |
| Visual | Not generated | Not applicable |
A required field is never null. If a record has no value for one, that record fails to load with an error that names the record and the field, for example Required field 'damage' on Weapon 'sword' has no value. Empty text and an empty colour count as no value. It can happen when a data file is edited by hand, or when a field is made required after its records were written.
Making a field required or optional changes its generated type, so code that reads .Value or .HasValue on it needs updating.
Lists
| Field type | C# type |
|---|---|
| Text | List<string> |
| Number | List<float> |
| Boolean | List<bool> |
| Enum | List< followed by the enum type, closed with > |
| Colour | A list of text, or a list of Color with Unity types |
| Reference | IEnumerable< followed by the target class, closed with > |
| Quantised reference list | List<QuantisedEntry< followed by the target class, closed with >> |
Lists are never null. A list property starts empty.
Setters
Properties have private setters, because the records are shared and cached. A change made in one place would otherwise show up everywhere. The exception is a formula field, whose value Stoatly fills in.
Deprecated fields
A deprecated field is still generated, and is marked [Obsolete] so your code gets a compiler warning where it's used.
When a reference can't be resolved
If a reference field's target type is no longer available, the property falls back to the slug as string?, or List<string> for lists, so the file still compiles.