CatalogKey

CatalogKey is a lightweight serializable reference:

  • Catalog (catalog id string)
  • Key (entry id string)

It intentionally stores strings only.

CatalogKey Dropdown and Preview

Inspector Experience

With CatalogKeyConstraint and registered catalogs, the inspector can show:

  • catalog/key dropdown selection
  • Asset-backed catalogs (IAssetCatalog): thumbnail preview and read-only ObjectField
  • Value catalogs (IValueCatalog): resolved display text next to the key (for example key 0Common when a StringCatalog maps tiers)

CatalogKeyConstraint today targets asset type for filtering catalogs; value-only catalogs still participate in key lists and display when registered under the same catalog id.

Even with preview UX, the stored value remains string data (Catalog + Key).

JSON Serialization

When the Newtonsoft pipeline is used, com.cupkekgames.newtonsoft ships a CatalogKeyConverter (registered by default via DataSerializationTypeProviderSO) that writes a CatalogKey as a compact "Catalog/Key" string instead of a nested object. An empty key serializes as null. The catalog id must not contain /; the key part may.

Current Mismatch Behavior

Current workflow is warning-oriented in inspector (no automatic fallback value assignment).

Example Usage

InventoryItemDefinition.IconKey can be constrained to sprite catalogs:

csharp
[CatalogKeyConstraint(InventoryConstants.IconsCatalogId, typeof(Sprite))] public CatalogKey IconKey;

Settings

Theme

Light

Contrast

Material

Dark

Dim

Material Dark

System

Sidebar(Light & Contrast only)

Light
Dark

Font Family

DM Sans

Wix

Inclusive Sans

AR One Sans

Direction

LTR
RTL