<aside> <img src="/icons/reorder_gray.svg" alt="/icons/reorder_gray.svg" width="40px" />
Navigation
</aside>
Item catalog for the shared merge board — split out from Progression and Balance to keep that page focused on levels and progression. These assets are stored in Assets/Project Files/Data/Level System.
Every object occupying a merge grid cell (the game unit) derives from MergeFieldObject (MonoBehaviour, ISelectableObject). It owns the item's TypeId / Grade, resolves GradeData from MergeDatabase, drives sprite/shadow visuals, half-locked state, selection bounce, and save/load hooks.
MergeItem - a plain mergeable item. Sellable (via ItemGradeConfig.sellPrice) or deletable.CurrencyItem - a currency pickup; tapping it collects the currency directly, no drag needed.EnergyItem - an energy pickup; tapping it collects the energy directly, no drag needed.SpawnerObject - spawns items from its SpawnPoolGradeConfig.spawnPool when tapped, at a cost of EnergyCost energy; unlimited uses.ChestObject - a SpawnerObject variant limited to ChestGradeConfig.maxSpawns charges, then removes itself.A subtype overrides CanDrag() and GetActionButton() to define its own interaction; typed behavior data (spawn pool, sell price, energy amount, …) lives on a MergeGradeConfig subclass, read back via GradeData.GetConfig<T>():
namespace Watermelon
{
public class MergeItem : MergeFieldObject
{
public override bool CanDrag() => !IsHalfLocked;
public override ActionButtonConfig GetActionButton()
{
int sellPrice = GradeData?.GetConfig<ItemGradeConfig>()?.SellPrice ?? 0;
if (sellPrice > 0)
return new ActionButtonConfig(ActionButtonType.Sell, "Sell", $"+{sellPrice}", sellPrice);
return new ActionButtonConfig(ActionButtonType.Delete, "Delete");
}
}
}
MergeDatabase asset in the Inspector.items array and add a new element.typeId (a unique string; uniqueness isn't enforced automatically, avoid reusing an existing one) and itemType matching the prefab's component (see item types below).prefab.grades (one entry per max grade): sprite, displayName, description, and pick config from its dropdown to match the item type (see below); optional custom shadow overrides.typeId from a level's CellConfig (via the Level Editor's right-click menu), a SpawnEntry in a spawner or chest's spawnPool, or a ClientOrderTaskDefinition, to actually use it in the game.| Type | Prefab component | Config | Fields |
|---|---|---|---|
| Item | MergeItem |
ItemGradeConfig |
sellPrice (int) |
| Currency item | CurrencyItem |
CurrencyGradeConfig |
currencyAmount (CurrencyAmount) |
| Energy item | EnergyItem |
EnergyGradeConfig |
amount (int) |
| Spawner | SpawnerObject |
SpawnerGradeConfig |
spawnPool (WeightedList<SpawnEntry>) |
| Chest | ChestObject |
ChestGradeConfig |
spawnPool (inherited), maxSpawns (int) |
Only needed for a new, unique item type - not for adding another item of an existing type. Duplicate an existing item prefab whose role matches what you need (see item types above), or build one with the matching MergeFieldObject subclass component plus its visual references (mainRenderer, shadowRenderer, lock overlays).
items - every MergeItemData in the game, looked up by typeId via GetItem(typeId).rareSpawnChancePercent - a spawn is flagged "rare" (e.g. for a callout effect) when its own roll chance within its spawner's pool is at or below this percentage.appearAudioClip / collectAudioClip - shared sounds played when any item spawns onto / is collected off the field.typeId - unique string id, referenced by CellConfig and by MergeFieldObject.TypeId.itemType - MergeItemType: Item, CurrencyItem, EnergyItem, Spawner, Chest.prefab - the MergeFieldObject prefab instantiated onto the grid for this item.grades - MergeGradeData[], one entry per merge grade (index 0 = grade 1). Array length is the item's max grade.sprite, displayName, description - this grade's visual and UI text.config - polymorphic ([SerializeReference]) MergeGradeConfig - the grade's type-specific behavior data, see below. Read via GetConfig<T>().customShadow / customShadowSprite / shadowPositionOffset / customShadowScale - override the default shadow sprite/position/scale for this grade only.Resolved per grade via GradeData.GetConfig<T>(); which subclass applies depends on the item's MergeItemType.
ItemGradeConfig (plain items, MergeItemType.Item)
sellPrice (int): 0 sets the action button to Delete; a value greater than 0 sets it to Sell for that price.CurrencyGradeConfig (currency pickups, MergeItemType.CurrencyItem)
currencyAmount (CurrencyAmount): currency type and amount granted when collected.EnergyGradeConfig (energy pickups, MergeItemType.EnergyItem)
amount (int): energy granted on pickup.SpawnerGradeConfig (spawners, MergeItemType.Spawner; extends SpawnPoolGradeConfig)
spawnPool (WeightedList<SpawnEntry>): pool of typeId + grade entries the spawner rolls from. Unlimited uses, gated only by energy cost.ChestGradeConfig (chests, MergeItemType.Chest; extends SpawnPoolGradeConfig)
spawnPool: inherited from SpawnPoolGradeConfig, same as Spawner.maxSpawns (int): number of uses before the chest removes itself.