reference
API reference
The public surface, condensed. Everything lives in the flat ItemGeneratorSystem namespace; the engine is static classes and plain data — no MonoBehaviours.
The engine
| Member | Type | Description |
|---|---|---|
| ItemGenerator.Generate(request) | static ItemInstance | Roll one item. Returns null (with a warning) on missing item type or rarity. |
| ItemGenerator.GenerateBatch(request, count) | static ItemInstance[] | Roll N items with per-index seeds derived from request.Seed. |
| ItemGenerationRequest | class | Template, ItemType, SubType, Rarity (required), Seed, Settings (required). |
| ItemGeneratorCallbacks.OnPostGenerate | static event Func<ItemInstance, ItemInstance> | Chained per-item hook run before Generate returns (and again on snapshot restore). Unsubscribe when done — it’s static. |
| SeedUtility | static class | GenerateRandomSeed() (entropy for new rolls) and DeriveVariationSeed(baseSeed, index) (batch seeds). |
Generated data
| Member | Type | Description |
|---|---|---|
| ItemInstance | class | The result: ItemName, RarityTypeLabel, type/sub-type/rarity refs, Icon/Prefab, BaseStats, ImplicitModifiers, RandomAffixes, SocketCount, LegendaryEffect, SellValue, MaxDurability, MaxStackSize, ItemLevel, GenerationSeed, GeneratorVersion, GenerationTimestamp, SourceTemplateName. |
| StatModifier | class | One rolled value: stat ref, value, GetDisplayString() ("+150 Attack", "+12.5% Crit Chance"). |
| GeneratedAffix | class | A rolled affix: source AffixDefinition ref + its rolled StatModifiers. |
| LegendaryEffect | class | EffectName, EffectDescription, EffectIcon, EffectId — the id is your gameplay lookup key. IsValid checks id + description. |
| ItemDefinition | ScriptableObject | An ItemInstance frozen as a project asset (editor GENERATE output); PopulateFromInstance() copies one in. |
Content definitions (ScriptableObjects)
All created under Assets ▸ Create ▸ Item Generator ▸ …:
| Member | Type | Description |
|---|---|---|
| GeneratorSettings | registry | AvailableRarities/Affixes/ItemTypes/SubTypes/Templates + NameConfig, output path & asset-name format, default seed options. Populated by Auto-Discover Content. |
| StatDefinition | SO | One stat: id, display name, StatValueType (Flat/Percentage/Multiplier), StatCategory. |
| RarityDefinition | SO | SortOrder, colors, affix & socket ranges, StatValueMultiplier, MinimumRollQuality, sell/durability multipliers, legendary flags, MaxNameAffixCount. |
| ItemTypeDefinition | SO | Base stat pool, implicit modifiers, allowed stats, base value/durability/stack, default icon & prefab. |
| ItemSubTypeDefinition | SO | Parent type + InheritanceMode (Inherit/Override/Extend/Restrict) + per-field overrides; Resolve…() methods expose the effective values. |
| AffixDefinition | SO | StatGrants, Weight, AffixType (Prefix/Suffix — display metadata), MinimumRarity/AllowedRarities, type/sub-type restrictions, ExclusionGroup. |
| ItemTemplate | SO | Base name/description/icon/prefab, stat & economy overrides, ForcedAffixes, AllowedRarities (+ IsRarityAllowed()), LegendaryEffect, ItemLevel. |
| NameGenerationConfig | SO | Prefixes / Suffixes / BaseNamePool / UniqueNames (NameFragment[]) + PrependArticleToUniqueName. |
| StatPoolEntry / NameFragment | class | The reusable range entry (stat, min, max, weight) and the weighted, condition-gated name text. |
Persistence
| Member | Type | Description |
|---|---|---|
| ItemInstancePersistence.Capture(item) | static ItemInstanceSnapshot | Six plain fields: seed, generator version, and the four definition names. |
| ItemInstancePersistence.Restore(snapshot, settings) | static ItemInstance | Resolves names through GeneratorSettings and regenerates. Null on unresolvable names; warns on version drift. |
Enums & helpers
| Member | Type | Description |
|---|---|---|
| StatValueType | enum | Flat, Percentage, Multiplier. |
| StatCategory | enum | Offensive, Defensive, Utility, Resource. |
| AffixType | enum | Prefix, Suffix. |
| InheritanceMode | enum | Inherit, Override, Extend, Restrict. |
| ValueCalculator | static class | CalculateSellValue(base, rarityMult, affixCount) and CalculateDurability(base, rarityMult). |
| StatRoller / AffixRoller / NameGenerator / WeightedSelector | static classes | The pipeline internals — public if you want to build custom generation flows from the same parts. |
| CardPalette | static class | The shared card colors, font sizes, and glyphs used by the demo card, editor preview, and ItemDefinition inspector — reuse it to match your own tooltips. |
| IGSDebug | static class | Logging gate — verbose logs compile only with the ITEM_GEN_DEBUG scripting define; warnings/errors always on. |
// note
Threading: the RNG travels through the pipeline as a
ref struct — generation is single-threaded by design. Don't share one ItemGenerationRequest across threads (GenerateBatch temporarily mutates its seed, restoring it in a finally).