API Reference
This page has a list of the main scripts and parts of the Decorating Toolkit.
Components
PlayerDecoratingController
The main script for dragging things. It handles your mouse input, finds objects, and manages the drag session.
- Key Methods: TryStartDrag(), StopDrag().
- Key Properties: IsDragging.
RigidbodyPlaceable
Put this on objects that use physics. Needs a Rigidbody.
StaticPlaceable
Put this on objects that dont use physics. They just move via their Transform.
SurfaceGrid
A script you can put on a floor or wall to give it its own snapping rules.
Core Interfaces
IDragMotor
How an object moves while you drag it.
- Begin(DragSession session): When you start dragging.
- Tick(DragSession session, float deltaTime): Runs every update to move the object.
- End(DragSession session, bool committed): When you let go.
IGrid
How grid snapping works. Used by GridSettings and SurfaceGrid.
- Snap(Vector3 position): Returns the snapped position.
IPlaceable
The interface for things that can be picked up. RigidbodyPlaceable is the basic one.
IPlacementValidator
Rules for if you can place an object.
- Validate(DragSession session): Checks if the current spot is okay.
IInteractable
Base interface for objects you can click or hover on.
IPointerSource
Tells the toolkit where your mouse or pointer is.
- TryGetPointer(out PointerState pointerState): Returns true if it finds a pointer.
IInteractionRaycaster
Handles finding objects under the mouse.
Data Structures
DragSession
Holds the info for the current drag.
- Actor: The player doing the dragging.
- Target: The thing being dragged.
- TargetPosition: Where the object wants to go.
- CurrentGrid: The active grid.
- IsPlacementValid: If the spot is legal or not.
Settings & Profiles (ScriptableObjects)
DecoratingToolkitSettings
The main asset where you link all your profiles and settings.
GridSettings
Sets the grid size and which axes to snap on.
PhysicsDragProfile
Settings for physics dragging (forces, dampening, etc).
StaticDragProfile
Settings for static dragging (lerp speed, offset).
PlacementValidationProfile
Sets which layers block placement and other rules.
InteractableProfile
Settings for interactables, like hover colors and distance.