| Class | Interfaces | Interaction |
InteractableObject_Pickup | IInteractable | Automatic — collected when the player steps on the tile. |
InteractableObject_Chest | IInteractable | Manual — requires an explicit Interact instruction. |
InteractableObject_Carry | ICarryObject · IPushable · IObstacle | Can be carried, pushed, and blocks movement. |
InteractableObject_PushableObject | IPushable · IObstacle | Can be pushed but not carried. Always blocks movement. |
InteractableObject_Door | IObstacle | Togglable blocker — can require a key item to open. |
InteractableObject_Pickup
Implements IInteractable with automatic = true. At the end of any turn the player occupies its tile, the item is added to context.inventory, a collect animation plays, and the GameObject is destroyed. No explicit Interact instruction is needed.
Inspector Fields
| Field | Type | Description |
item | Item | The item added to the player's inventory when collected. |
audioSource | AudioSource | AudioSource used for collect and drop sounds. |
collectSound | AudioClip | Played when the player picks up this object. |
dropSound | AudioClip | Played when the object is placed in the world. |
IInteractable Members
| Member | Value / Behaviour |
automatic | true — collected at turn end without any instruction. |
OnInteract | UnityEvent — fired when the item is successfully collected. |
Validate() | Always returns true. |
Interact() | Calls context.inventory.TryAddItem(item), plays the collect animation, destroys the GameObject. |
Additional Methods
| Method | Description |
Drop() | Plays dropSound. Called when the object is placed (or reset) into the world. |
InteractableObject_Chest
Implements IInteractable with automatic = false. The player must use an Interact instruction while on the chest's tile. On success the item is added to inventory, an open animation plays, and the item icon floats above the chest.
Inspector Fields
| Field | Type | Description |
item | Item | Item type stored in the chest. |
amount | int | Number of units given to the player. Default: 1. |
itemIcon | SpriteRenderer | Displays the item's sprite above the chest after opening. |
amountText | TMP_Text | Shows the quantity string (e.g. ×5) when more than one item is given. |
audioSource | AudioSource | AudioSource for the open sound. |
openSound | AudioClip | Played when the chest opens. |
IInteractable Members
| Member | Value / Behaviour |
automatic | false — requires an explicit Interact instruction. |
OnInteract | UnityEvent — fired when the chest is successfully opened. |
Validate() | Returns true if item is assigned. |
Interact() | Calls context.inventory.TryAddItem(item, amount), triggers the open animation, and updates the item icon display. |
InteractableObject_Carry
Implements ICarryObject, IPushable, and IObstacle. The player can pick it up with Carry, put it down with Drop, or slide it one tile with Push. Its collider is disabled while carried so it does not interfere with movement.
Inspector Fields
| Field | Type | Description |
audioSource | AudioSource | AudioSource for all carry / push sounds. |
pickupSound | AudioClip | Played when the player picks up the object. |
dropSound | AudioClip | Played when the player drops the object. |
pushSound | AudioClip | Played when the object is pushed. |
Interface Members
| Method / Property | Interface | Behaviour |
Take() | ICarryObject | Disables the BoxCollider2D and plays pickupSound. |
Drop() | ICarryObject | Re-enables the collider and plays dropSound. |
Push(context, direction) | IPushable | Moves the object one cell in direction using MapManager.cellSize and plays pushSound. |
Stop() | IPushable | Stops the push sound if it is still playing. |
Validate() | IObstacle | Always returns false — the object acts as a solid obstacle. Push validation is handled by the default IPushable.Validate() implementation. |
💡
IObstacle.Validate() vs IPushable.Validate()
IObstacle.Validate() returns true when the object should block movement (always, for a solid crate). IPushable.Validate(direction) is the separate check that determines whether a push is legal — it uses Physics2D.OverlapBoxAll to detect IObstacle objects in the target cell.
InteractableObject_PushableObject
Implements IPushable and IObstacle. A static object (stone block, boulder) that can be pushed one tile per instruction but cannot be carried. Always blocks movement.
Inspector Fields
| Field | Type | Description |
audioSource | AudioSource | AudioSource for the push sound. |
pushSound | AudioClip | Played when the object is pushed. |
Interface Members
| Method | Interface | Behaviour |
Push(context, direction) | IPushable | Moves the object one cell in direction and plays pushSound. |
Stop() | IPushable | Stops the push sound if it is still playing. |
Validate() | IObstacle | Always returns false — the object is always a solid obstacle. |
InteractableObject_Door
Implements IObstacle. Blocks passage while closed; passage is allowed once open. Can optionally require the player to carry a specific key item before the door will open. Controls an Animator and disables its Collider2D while open.
Inspector Fields
| Field | Type | Description |
requireKey | bool | When true, the player must be carrying the key item to open the door. |
key | Item | The key item required. Only checked when requireKey is true. |
audioSource | AudioSource | AudioSource for open and close sounds. |
openSound | AudioClip | Played when the door opens. |
closeSound | AudioClip | Played when the door closes. |
Public Properties
| Property | Type | Description |
isOpen | bool | Read-only. true while the door is open. Setting this drives the Animator and enables / disables the Collider2D. |
OnInteract | UnityEvent | Fired each time the player successfully interacts with the door. |
Public Methods
| Method | Description |
Open() | Opens the door — sets isOpen = true, disables the collider, and triggers the open animation. Only affects the execution clone. |
Close() | Closes the door — sets isOpen = false, re-enables the collider, and triggers the close animation. |
Interact(ExecutionContext context) | Toggles the door between open and closed. If requireKey is set, verifies that context.inventory contains the key item before opening. |
IObstacle Member
| Method | Behaviour |
Validate() | Returns !isOpen — blocks movement when closed, passable when open. |