<aside> <img src="/icons/reorder_gray.svg" alt="/icons/reorder_gray.svg" width="40px" />

Navigation

</aside>

🏠 Home Page

Overview

Progression and Balance

Merge Items & Branches

Dialogs

Energy

Experience

Tutorial

UI Store

💰 Monetization (Ads & IAP)

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.

Game unit - MergeFieldObject

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.

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");
        }
    }
}

How to add a new merge item

  1. Prepare a prefab. In most cases you don't need to duplicate or create one - for a simple item (e.g. coffee, cake) just reuse an existing prefab and item type (see item types below). Duplicating or building a new prefab is only needed when introducing a new, unique item type, see Creating a new item prefab below.
  2. Open the MergeDatabase asset in the Inspector.
  3. Expand the items array and add a new element.
  4. Set 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).
  5. Assign prefab.
  6. Fill in 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.
  7. Reference the new 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.

Item types

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)

Creating a new item prefab

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).

MergeDatabase fields

MergeItemData

MergeGradeData (per grade)

Grade configs (MergeGradeConfig subclasses)

Resolved per grade via GradeData.GetConfig<T>(); which subclass applies depends on the item's MergeItemType.

ItemGradeConfig (plain items, MergeItemType.Item)

CurrencyGradeConfig (currency pickups, MergeItemType.CurrencyItem)

EnergyGradeConfig (energy pickups, MergeItemType.EnergyItem)

SpawnerGradeConfig (spawners, MergeItemType.Spawner; extends SpawnPoolGradeConfig)

ChestGradeConfig (chests, MergeItemType.Chest; extends SpawnPoolGradeConfig)