ClassInterfacesInteraction
InteractableObject_PickupIInteractableAutomatic — collected when the player steps on the tile.
InteractableObject_ChestIInteractableManual — requires an explicit Interact instruction.
InteractableObject_CarryICarryObject · IPushable · IObstacleCan be carried, pushed, and blocks movement.
InteractableObject_PushableObjectIPushable · IObstacleCan be pushed but not carried. Always blocks movement.
InteractableObject_DoorIObstacleTogglable 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

FieldTypeDescription
itemItemThe item added to the player's inventory when collected.
audioSourceAudioSourceAudioSource used for collect and drop sounds.
collectSoundAudioClipPlayed when the player picks up this object.
dropSoundAudioClipPlayed when the object is placed in the world.

IInteractable Members

MemberValue / Behaviour
automatictrue — collected at turn end without any instruction.
OnInteractUnityEvent — 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

MethodDescription
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

FieldTypeDescription
itemItemItem type stored in the chest.
amountintNumber of units given to the player. Default: 1.
itemIconSpriteRendererDisplays the item's sprite above the chest after opening.
amountTextTMP_TextShows the quantity string (e.g. ×5) when more than one item is given.
audioSourceAudioSourceAudioSource for the open sound.
openSoundAudioClipPlayed when the chest opens.

IInteractable Members

MemberValue / Behaviour
automaticfalse — requires an explicit Interact instruction.
OnInteractUnityEvent — 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

FieldTypeDescription
audioSourceAudioSourceAudioSource for all carry / push sounds.
pickupSoundAudioClipPlayed when the player picks up the object.
dropSoundAudioClipPlayed when the player drops the object.
pushSoundAudioClipPlayed when the object is pushed.

Interface Members

Method / PropertyInterfaceBehaviour
Take()ICarryObjectDisables the BoxCollider2D and plays pickupSound.
Drop()ICarryObjectRe-enables the collider and plays dropSound.
Push(context, direction)IPushableMoves the object one cell in direction using MapManager.cellSize and plays pushSound.
Stop()IPushableStops the push sound if it is still playing.
Validate()IObstacleAlways 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

FieldTypeDescription
audioSourceAudioSourceAudioSource for the push sound.
pushSoundAudioClipPlayed when the object is pushed.

Interface Members

MethodInterfaceBehaviour
Push(context, direction)IPushableMoves the object one cell in direction and plays pushSound.
Stop()IPushableStops the push sound if it is still playing.
Validate()IObstacleAlways 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

FieldTypeDescription
requireKeyboolWhen true, the player must be carrying the key item to open the door.
keyItemThe key item required. Only checked when requireKey is true.
audioSourceAudioSourceAudioSource for open and close sounds.
openSoundAudioClipPlayed when the door opens.
closeSoundAudioClipPlayed when the door closes.

Public Properties

PropertyTypeDescription
isOpenboolRead-only. true while the door is open. Setting this drives the Animator and enables / disables the Collider2D.
OnInteractUnityEventFired each time the player successfully interacts with the door.

Public Methods

MethodDescription
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

MethodBehaviour
Validate()Returns !isOpen — blocks movement when closed, passable when open.