API reference
Every public type and member. The task pages explain how these fit together; this page is the complete, exact surface.
All types live in the DebugMD namespace except the two
entry points DMD and DMDEditor, which are
global so call sites need no using directive.
DMD
static class The runtime entry point. Global namespace.
| Member | Description |
|---|---|
POptionsRegistry Options |
Registers and removes the options shown in the panel. See Option types. |
Mvoid Init() |
Starts Debug MD when Auto Load is off. Idempotent, and a
no-op when Auto Load already started it. Callable from
AfterAssembliesLoaded on: before the first scene
load the start is queued until the scene has loaded. Does
nothing in batch mode or when stripped. See
Starting it yourself. |
Pbool IsInitialized |
Whether Debug MD is running, started by Auto Load or
Init(). False while a queued start waits for the
first scene, and always false when stripped. |
Mvoid ShowPanel() |
Opens the debug panel, starting Debug MD first if it isn't running yet. |
Mvoid HidePanel() |
Closes the debug panel. |
Mvoid TogglePanel() |
Opens the panel if closed, closes it if open. Starts Debug MD first if it isn't running yet. |
Mvoid DestroyPanel() |
Destroys the panel's visual tree to reclaim its memory. Registered options are unaffected; the panel rebuilds on the next open. Pinned widgets stay on screen. |
Mvoid SetTheme(StyleSheet theme) |
Applies a theme stylesheet on top of the built-in styles.
Affects every Debug MD surface immediately, including pinned
widgets and the editor window. Pass null to return
to the default look. See Theming. |
Pbool IsPanelVisible |
Whether the panel is currently visible. |
Mbool IsPointerOverPanel(Vector2 screenPosition) |
Whether a screen position lands on Debug MD: the open panel,
or a pinned widget at any time. Takes the position as the input
systems report it (Input.mousePosition,
Pointer.current.position, a touch position - origin
bottom-left). For game code that reads input directly, so taps
meant for the panel don't also fire in the game. See
From code. |
EAction<bool> PanelVisibilityChanged |
Raised when the panel opens or closes. Useful for suppressing game input while the panel is visible. |
EAction PanelOpened |
Raised when the panel opens. Where a game does whatever it wants done while a debug panel is up: pause, mute, stop a tween engine. Debug MD changes nothing itself beyond freeing the cursor. See While the panel is open. |
EAction PanelClosed |
Raised when the panel closes. Undoes whatever
PanelOpened did; every open pairs with exactly one
close. |
DMDEditor
static class The entry point for editor-only options, shown by the Debug MD window outside play mode (and in the play-mode panel too, when the settings ask for it). Global namespace; editor assemblies only. See Editor-mode options.
| Member | Description |
|---|---|
POptionsRegistry Options |
Registers and removes the options shown while out of play mode (and in the play-mode panel's Edit Mode tab, when that setting is on). |
OptionsRegistry
class Holds the options shown in
a panel. Access via DMD.Options or
DMDEditor.Options - instances are not user-creatable.
Options can be added and removed at any time; the panel updates
immediately. Not thread-safe: register from the main thread.
| Member | Description |
|---|---|
Cstring DefaultTab |
"Options" - the tab used when none is
specified. |
Cstring DefaultCategory |
"General" - the category used when none is
specified. |
MOptionHandle Add(Option option) |
Adds an option. Returns a handle for removing it or pushing a
value refresh. Throws ArgumentNullException for
null and InvalidOperationException if the same
instance is already registered. |
MOptionHandle Add(Option option, Object owner) |
Adds an option tied to a UnityEngine.Object
owner: when the owner is destroyed, the option is removed
automatically. See Lifetime &
scopes. |
MOptionsScope CreateScope() |
Creates a scope whose options are all removed together when the scope is disposed. |
Mvoid SetTabIcon(DmdIcon icon, string tab, params string[] subTabs) |
Shows a glyph before a tab's name in the tab bar, in the
tab's text color. The tab is named as in InTab,
outermost first; the implicit General sub tab is named
"General". Order independent, harmless for a tab
that never appears, not removed with options, scopes or owners.
DmdIcon.None removes it. See
Tab icons. |
Mvoid SetTabIcon(string resourcePath, string tab, params string[] subTabs) |
The same with an image under a Resources folder (full project path or Resources-relative), full-color. Takes precedence over a glyph; null or empty removes it. |
IOptionsRegistrar
interface Anything options can
be registered into: the registry itself or a scope. Lets registration
code work with either, and carries the Add... shorthand
extensions below.
| Member | Description |
|---|---|
MOptionHandle Add(Option option) |
Adds an option and returns its handle. |
Registration shorthands
static class
OptionsRegistrarExtensions - extension methods on
IOptionsRegistrar that fold the factory into the
registration call. Each returns the created option (not the
handle), so fluent modifiers chain on directly. Use
Add instead when you need the OptionHandle or
an owner-bound registration.
| Extension | Registers |
|---|---|
EAddToggle(name, getter, setter = null) |
A boolean toggle. Read-only without a setter. Returns
ToggleOption. |
EAddInt(name, getter, setter = null) |
An integer number control. Add WithRange for a
range bar. Returns IntOption. |
EAddFloat(name, getter, setter = null) |
A float number control. Add WithRange for a
range bar. Returns FloatOption. |
EAddLong(name, getter, setter = null) |
A 64-bit integer number control, for values an int cannot
hold. Add WithRange for a range bar. Returns
LongOption. |
EAddDouble(name, getter, setter = null) |
A double-precision number control, for values a float would
round away. Add WithRange for a range bar. Returns
DoubleOption. |
EAddText(name, getter, setter = null) |
A string field. Read-only without a setter. Returns
TextOption. |
EAddChoice<TEnum>(name, getter, setter = null) |
An enum choice picked from a searchable full-screen list.
Returns ChoiceOption<TEnum>. |
EAddButton(name, action) |
A button invoking the action. Returns
ButtonOption. |
EAddInfo(name, getter) |
A read-only text row for surfacing debug information.
Returns InfoOption. |
EAddPicker<T>(name, items, label, getter, setter = null) |
A single-select picker. items is either an
IReadOnlyList<T> or a
Func<IReadOnlyList<T>> provider
re-queried on every open. Returns
PickerOption<T>. |
EAddMultiPicker<T>(name, items, label, isSelected, setSelected = null) |
A picker where any number of items can be toggled. Selection
state lives in caller code behind the adapters. Returns
MultiPickerOption<T>. |
Option
abstract class One entry in the
panel. Create instances with the static factories, configure with the
fluent modifiers, register via Add. Apply type-specific
modifiers (such as WithRange) before the placement
modifiers.
Properties
| Property | Description |
|---|---|
string Name |
Display name shown in the panel. Set at creation; never null or empty. |
string Tab |
Tab the option appears under. Defaults to
"Options". |
IReadOnlyList<string> SubTabs |
Sub tabs below Tab, outermost first, up to
three. Empty for an option directly in its tab. See
Sub tabs. |
string Category |
Category the option is grouped by within its tab. Defaults
to "General". |
string Row |
Row key grouping this option side by side with others.
null (default) renders it on its own row. |
float RowWidth |
Declared width as a percentage of the row. Zero (default) shares the row equally with the other unsized members. |
float Height |
Declared height in reference pixels. Zero (default) sizes to content. |
bool LabelAbove |
The label position declared with
WithLabelAbove: true for above the control, false
for beside it. Undeclared it is false and the panel decides by
width. |
int Order |
Sort order within the category; lower first. |
DmdIcon Icon |
Glyph icon shown with the option. Defaults to
DmdIcon.None. |
string IconPath |
Path of an image icon, as passed to
WithIcon(string). Overrides Icon when
set; null when unset. |
Static factories
| Factory | Creates |
|---|---|
Option.Toggle(name, getter, setter = null) |
ToggleOption - boolean toggle; read-only without
a setter. |
Option.Int(name, getter, setter = null) |
IntOption - integer number control; range bar
with WithRange. |
Option.Float(name, getter, setter = null) |
FloatOption - float number control; range bar
with WithRange. |
Option.Long(name, getter, setter = null) |
LongOption - 64-bit integer number control;
range bar with WithRange. |
Option.Double(name, getter, setter = null) |
DoubleOption - double-precision number control;
range bar with WithRange. |
Option.Text(name, getter, setter = null) |
TextOption - string field; read-only without a
setter. |
Option.Choice<TEnum>(name, getter, setter = null) |
ChoiceOption<TEnum> - enum choice via the
searchable picker overlay. TEnum : struct, Enum. |
Option.Picker<T>(name, items, label, getter, setter = null) |
PickerOption<T> - single-select picker.
items: fixed list or provider delegate. |
Option.MultiPicker<T>(name, items, label, isSelected, setSelected = null) |
MultiPickerOption<T> - multi-select
picker. items: fixed list or provider
delegate. |
Option.Button(name, action) |
ButtonOption - invokes the action. The action
must not be null. |
Option.Info(name, getter) |
InfoOption - read-only live text row. |
Placement modifiers
All return the option (as Option), may be called before
or after registration, and take effect immediately. Details and layout
rules: Tabs, rows & layout.
| Modifier | Effect |
|---|---|
InTab(string tab) |
Places the option under the tab. Null or empty reverts to the default tab. |
InTab(string tab, params string[] subTabs) |
Places the option in nested sub tabs under the tab, outermost first. Up to three levels; deeper ones are ignored with a warning, and the path ends at the first null or empty name. A tab with its own options and sub tabs shows its own options in a first sub tab named "General". |
InCategory(string category) |
Groups the option under the category within its tab. Null or empty reverts to the default category. |
InRow(string row) |
Lays the option side by side with every option sharing the row key within its tab and category. Null or empty removes it from the row. |
WithWidth(float percent) |
Share of the row's width, percent only. Above 100 clamps to 100; zero or below reverts to equal sharing. Honored only inside a row. |
WithHeight(float pixels) |
Height in reference pixels, scaled with the panel's UI scale. Values under the panel's minimum row height are raised to it. |
WithLabelAbove(bool above = true) |
Fixes the label above the control (true) or
beside it (false). Undeclared, text fields and
pickers move their label above in rows narrower than about 420
reference pixels and numbers below about 290; everything else
keeps it beside. Declaring either way turns that off. In a row,
the whole line follows. Ignored by buttons and by pinned
copies. See Labels. |
WithOrder(int order) |
Sort order within the category; lower first. |
WithIcon(DmdIcon icon) |
Shows a glyph icon: inside the button for buttons, in front of the title otherwise. |
WithIcon(string resourcePath) |
Shows an image icon from a Resources folder. Accepts the full project path or the Resources-relative form. Takes precedence over the glyph; warns once and falls back if the image can't load. |
ValueOption<T>
abstract class Base for options backed by a value, read and written through the supplied delegates - no reflection is involved at any point. Base of the toggle, int, float, long, double, text, choice and info options.
| Member | Description |
|---|---|
Pbool IsReadOnly |
True when no setter was supplied; the widget renders read-only. |
Typed options
class ToggleOption : ValueOption<bool>
A boolean toggle. No members beyond the base and the shared modifiers.
class IntOption : ValueOption<int>
WithRange(int min, int max) |
Constrains the value and adds a range bar just below the value box that drags like a slider. |
WithStep(int step) |
Step for the arrows, scrubbing and range-bar snapping. Values below 1 are raised to 1. Default 1. |
WithCurve(float exponent = 3f) |
Makes the range non-linear: bar position t stands
for the fraction texponent. Above 1 gives
fine control at the low end (2-3 feels logarithmic), below 1 at
the top. Bar, scrubbing and arrows follow it on tidy values;
typing stays exact. Needs WithRange. Clamped to
0.1-10. See Curves. |
WithStepButtons(bool enabled = true) |
Forces the step arrows on or off for this option. Unset, the option follows the Step Buttons setting. Read-only options never show them. |
class FloatOption : ValueOption<float>
WithRange(float min, float max) |
Constrains the value and adds a range bar just below the value box that drags like a slider. |
WithStep(float step) |
Step for the arrows, scrubbing and range-bar snapping.
0 = continuous (the default): the range bar snaps
to nothing, the arrows step by 1 and unranged scrubbing moves in
tenths. Negative values are treated as 0. |
WithCurve(float exponent = 3f) |
Makes the range non-linear: bar position t stands
for the fraction texponent. Above 1 gives
fine control at the low end (2-3 feels logarithmic), below 1 at
the top. Bar, scrubbing and arrows follow it on tidy values;
typing stays exact. Needs WithRange. Clamped to
0.1-10. See Curves. |
WithStepButtons(bool enabled = true) |
Forces the step arrows
on or off for this option. They step by WithStep,
or by 1 when no step was declared. Unset, the option follows the
Step Buttons setting. |
class LongOption : ValueOption<long>
WithRange(long min, long max) |
Constrains the value and adds a range bar that drags like a slider. The math stays exact 64-bit. |
WithStep(long step) |
Step for the arrows, scrubbing and range-bar snapping. Values below 1 are raised to 1. Default 1. |
WithCurve(float exponent = 3f) |
Makes the range non-linear: bar position t stands
for the fraction texponent. Above 1 gives
fine control at the low end (2-3 feels logarithmic), below 1 at
the top. Bar, scrubbing and arrows follow it on tidy values;
typing stays exact. Needs WithRange. Clamped to
0.1-10. See Curves. |
WithStepButtons(bool enabled = true) |
Forces the step arrows on or off. Unset, the option follows the Step Buttons setting. |
class DoubleOption : ValueOption<double>
WithRange(double min, double max) |
Constrains the value and adds a range bar that drags like a slider. |
WithStep(double step) |
Step for the arrows, scrubbing and range-bar snapping.
0 is the default: the arrows step by 1 and
unranged scrubbing moves in tenths. Negative values are treated
as 0. |
WithCurve(float exponent = 3f) |
Makes the range non-linear: bar position t stands
for the fraction texponent. Above 1 gives
fine control at the low end (2-3 feels logarithmic), below 1 at
the top. Bar, scrubbing and arrows follow it on tidy values;
typing stays exact. Needs WithRange. Clamped to
0.1-10. See Curves. |
WithStepButtons(bool enabled = true) |
Forces the step arrows on or off. Unset, the option follows the Step Buttons setting. |
class TextOption : ValueOption<string>
A string field. No members beyond the base and the shared modifiers.
class ChoiceOption<TEnum> : ValueOption<TEnum>
An enum option. Renders the current value in the row; choosing
opens the searchable picker overlay. TEnum : struct,
Enum. No extra members.
class ButtonOption : Option
WithKeyBinding(KeyCode key) |
Also invokes the action when the key is pressed during play, whether the panel is open or closed. Presses are ignored while a text field is being edited; buttons sharing a key all fire. Inactive (and unhinted) on platforms without a physical keyboard. |
class InfoOption : ValueOption<string>
A read-only text row for surfacing debug information. Always read-only.
PickerOptionBase<T, TSelf>
abstract class Shared shape of
the two picker options: the item collection, display adapters and layout
modifiers. All modifiers return TSelf, so chains keep the
concrete picker type. See Pickers.
| Modifier | Effect |
|---|---|
WithKeywords(Func<T, string> keywords) |
Extra text the search matches besides the label - a rarity, a category name, aliases. |
WithDetail(Func<T, string> detail) |
A secondary line shown under the selected item's name in the panel row. |
WithIcon(Func<T, Sprite> icon) |
Shows the sprite next to each item. |
WithIcon(Func<T, Texture2D> icon) |
Shows the texture next to each item. |
WithGridView() |
Opens the picker as a grid of icon tiles. Takes effect only when an icon adapter is set; icon pickers always offer a list/grid toggle - this chooses the starting layout. |
AsDisplay() |
Renders the row as a display instead of a button: the current item's icon, name and detail, updated live from the getter, with no button box, no hover or press state, and never opening the overlay. An empty value shows blank (no Select..., no ? tile). For live previews; see Live preview. Without it, a picker with no setter is browse-only. |
PickerOption<T>
sealed class Chooses one item out of a collection. The selection is read and written through the getter/setter delegates, so the chosen item lives in caller code. The provider is re-queried every time the picker opens. Without a setter the picker is browse-only.
| Member | Description |
|---|---|
MOnPicked(Action<T> action) |
Runs right after a pick is written through the setter - for flows that apply the pick immediately. The standard pattern needs no action here: the picker stores the selection and a separate button acts on it. |
MultiPickerOption<T>
sealed class A picker where any
number of items can be toggled on and off. Selection state lives
entirely in caller code behind the
isSelected/setSelected adapters - typically a
set. The panel row summarizes the selection; the overlay stays open
while toggling. Without setSelected it is browse-only. No
members beyond PickerOptionBase.
OptionHandle
sealed class Returned when registering an option. See Lifetime & scopes and Pin to screen.
| Member | Description |
|---|---|
POption Option |
The option this handle controls. |
Pbool IsRegistered |
Whether the option is currently registered. |
Mvoid Remove() |
Removes the option from the panel. Safe to call more than once. |
Mvoid NotifyChanged() |
Pushes an immediate value refresh to the option's widget. Never required - visible widgets refresh automatically - but useful after a burst of changes. |
Pbool IsPinned |
Whether the option is pinned to the screen as a floating widget. |
Mvoid Pin() |
Pins the option to the screen as a floating widget outside the panel. |
Mvoid Unpin() |
Removes the option's floating widget from the screen. |
OptionsScope
sealed class
IOptionsRegistrar, IDisposable. Registers a
batch of options that are all removed together when the scope is
disposed - options tied to a level, a live-ops event, or any other
temporary context. Created via
OptionsRegistry.CreateScope().
| Member | Description |
|---|---|
MOptionHandle Add(Option option) |
Adds an option that lives until this scope is disposed. All
Add... shorthands work on scopes too. |
Mvoid Dispose() |
Removes every option registered through this scope. |
DebugMDSettings
sealed class
ScriptableObject holding the project-wide configuration. A
single instance lives in any folder of the project (not a Resources
folder), created and edited via Window › Debug MD › Settings,
and reaches builds as a preloaded asset added at build time; when no
asset exists, the
defaults below apply. Several values can be overridden per device from
the panel's About page - the properties here already resolve those
overrides. See Opening &
configuring.
| Member | Default | Description |
|---|---|---|
SDebugMDSettings Instance |
- | The active settings; loads the asset on first access, falls back to defaults when none exists. |
bool AutoLoad |
true |
Whether Debug MD initializes itself on startup without scene
setup. When off, DMD.Init() starts it. |
bool DestroyOnClose |
false |
Whether the panel UI is destroyed each time it closes, freeing its memory until reopened. |
bool ShowCursorWhileOpen |
true |
Whether the cursor is shown and unlocked while the panel is open, with the game's own cursor state restored on close. See While the panel is open. |
PanelTriggerMode TriggerMode |
TripleTapOrHoldCorner |
Touch gesture that opens the panel on device. |
ScreenCorner TriggerCorner |
TopLeft |
Corner used by the corner-based triggers. |
KeyCode KeyboardShortcut |
F1 |
Keyboard shortcut toggling the panel on desktop platforms. |
bool RequirePassword |
false |
Whether the panel asks for a password before opening, once per app session. Inactive while no password is set. |
float PinnedSnapTolerance |
24 |
Distance in pixels at which the pinned dock snaps to a screen edge while dragging. |
bool StepButtons |
true |
Whether number options show step
arrows by default. Options calling
WithStepButtons ignore this. |
bool SubTabMarkers |
true |
Whether tabs that hold sub tabs show a small down chevron after their name. |
PollFrequency PollFrequency |
Medium |
How often visible widgets re-read option values from game code. |
bool ProfilerDisabled |
false |
Whether the profiler is turned off: no sampling, no pinnable mini profiler, a dimmed profiler button. No device override. See Turning it off. |
int ConsoleMaxEntries |
10000 |
How many log entries the console retains, clamped to 256-200,000. Device overrides apply on the next launch. |
bool ErrorSignal |
true |
Whether a red exclamation mark pulses in the trigger corner when an error or exception is logged. Uses the trigger corner for corner gestures, top-left otherwise. See the error signal. |
bool WarningSignal |
false |
Whether an amber warning mark pulses in the same corner when a warning is logged. An error takes over a warning at once; a warning during an error is dropped. |
int ErrorSignalSeconds |
4 |
How long the error signal pulses after an error, in whole seconds (1-30). |
float PanelOpacity |
0.75 |
How opaque the open panel's background is, 0.1-1. Text, controls and the header stay solid; the editor window ignores it. |
float PinnedOpacity |
0.75 |
How opaque the pinned widgets' background is, 0.1-1. Their text and controls stay solid. |
bool EditModeOptionsInPlayMode |
false |
Editor only: whether the play-mode panel also shows the edit-mode options under a tab of their own. |
IReadOnlyList<StyleSheet> AdditionalThemes |
empty | Extra theme stylesheets offered by the panel's theme picker beside the built-in ones. See Theming. |
float PanelSortingOrder |
10000 |
Sort order of the runtime panel against other UI Toolkit panels and uGUI canvases; the higher value draws on top and takes input first. Applied when the panel starts. |
PanelSettings PanelSettingsOverride |
null |
The PanelSettings replacing the built-in one for the runtime
panel, or null for the built-in one.
PanelSortingOrder still applies on top. |
Enums
enum PanelTriggerMode
Disabled |
No touch trigger. The panel can still open via keyboard shortcut or code. |
ThreeFingerTap |
Tap anywhere with three fingers simultaneously. |
TripleTapCorner |
Triple-tap the configured screen corner. |
TapAndHoldCorner |
Press and hold the configured corner for half a second. |
TripleTapOrHoldCorner |
Either corner gesture opens the panel. |
enum ScreenCorner
A corner of the screen, in safe-area coordinates:
TopLeft, TopRight, BottomLeft,
BottomRight.
enum PollFrequency
Fast | 20 refreshes per second. |
Medium | 10 refreshes per second. |
Slow | 4 refreshes per second. |
enum DmdIcon
The glyph icons available for WithIcon - the full
bundled Material Icons set (Apache 2.0), with names mirroring the
icon set's own in PascalCase: DmdIcon.BugReport,
DmdIcon.Favorite, DmdIcon.Bolt,
DmdIcon.Settings, and roughly two thousand more.
DmdIcon.None means no icon. Browse names with your IDE's
completion - they match
the Material
Icons gallery.