Skip to content

Modular Card Prefab

ModularCardBase defines the visual layout. ModularCardView assigns data to its slots.

Expected hierarchy

ModularCardBase
├── CardArt
├── CardDesc
│   └── Text (TMP)
├── EdgeLeft
├── EdgeRight
├── CornerTopLeft
├── CornerTopRight
├── CornerBotLeft
├── CornerBotRight
├── OrnamentTop
├── OrnamentBottom
├── NamePlate
│   └── Text (TMP)
├── Attack
│   └── Text (TMP)
├── Defense
│   └── Text (TMP)
├── Mana
│   └── Text (TMP)
└── Gem

Automatic binding

  1. Add ModularCardView to the root.
  2. Press Auto Assign From Prefab.
  3. Confirm all Image and TMP fields are populated.
  4. Press Refresh Preview.

Automatic binding uses the object names above.

Reusable prefab rule

For cards created by CardDealerManager, save the prefab with:

Card: None
Design Override: None

The dealer assigns the Card Definition at runtime. The Card Definition then selects its own template.

One prefab, many cards

Do not create one prefab per character unless a card requires a genuinely different hierarchy. One modular prefab plus multiple data assets is easier to maintain and update.