Skip to content

API Reference

This is a practical reference (not a novel).

Dice

Purpose: Holds face marker mapping and provides GetTopValue() and TryGetMarker(value).

Typical fields: - MaxFaceValue (>= 2) - marker list / dictionary

Typical methods: - bool TryGetMarker(int value, out Transform marker) - int GetTopValue()

PhysicsDiceRoller3D (World)

Purpose: Spawn + apply impulse/torque + wait until stable + read top face.

Typical call:

roller.Roll(dicePrefab, result => { ... });

Some implementations also offer:

roller.Roll(dicePrefab, outcome => { outcome.die; outcome.value; });

UIDiceRoller3D (UI)

Purpose: Instantiate die under a stage, animate (move-in, spin+drift), then settle to a desired value.

Typical call:

uiRoller.Roll(dicePrefab, desiredValue, result => { ... });

Key settings: - stageExtent, spinTime, settleTime, spinDegreesPerSec - returnToCenterStart, returnEase (reduces “teleport” feel)

DiceRollUIController (optional)

Purpose: Build rows + animate floating numbers into rows, with Sum/Highest + DC.

Typical call:

uiController.RollAll();