DebugRegistry
Defined in: types.ts:95
Service interface for the debug registry.
Methods
Section titled “Methods”drawVector()
Section titled “drawVector()”drawVector(
entity,vector,options?): () =>void
Defined in: types.ts:124
Draw an arrow on entity for a vector that is read fresh every frame —
velocity, aim direction, knockback, steering output.
// tryResolve, not use(): use() throws without DebugPlugin installed.const debug = this.context.tryResolve(DebugRegistryKey);this.stopArrow = debug?.drawVector(this.entity, () => agent.velocity, { scale: 0.35, color: 0x4ade80, minLength: 1,});The arrow starts at the entity’s world position (plus options.origin)
and points along the vector. Nothing is retained but the provider itself:
it is called once per frame while the overlay is on and the vectors
contributor’s arrows flag is enabled, and not at all otherwise — a
drawVector call in a hot path costs nothing while debug is off.
Returns a disposer that stops the drawing. Calling it twice is harmless. The registration is also dropped when the entity’s life ends — destroyed, or a pool member whose lease ended — so a provider closure never outlives the entity it draws for, and a per-lease registration never accumulates.
Parameters
Section titled “Parameters”entity
Section titled “entity”Entity
vector
Section titled “vector”options?
Section titled “options?”Returns
Section titled “Returns”() => void
isEnabled()
Section titled “isEnabled()”isEnabled():
boolean
Defined in: types.ts:97
Returns
Section titled “Returns”boolean
isFlagEnabled()
Section titled “isFlagEnabled()”isFlagEnabled(
contributorName,flag):boolean
Defined in: types.ts:98
Parameters
Section titled “Parameters”contributorName
Section titled “contributorName”string
string
Returns
Section titled “Returns”boolean
register()
Section titled “register()”register(
contributor):void
Defined in: types.ts:96
Parameters
Section titled “Parameters”contributor
Section titled “contributor”Returns
Section titled “Returns”void