EntityCountDiagnosticPlugin

View source

ExtendsPlugin

Adds a browser overlay that displays the number of entities in the app’s default world.

In a browser, the overlay appears near the top-right corner and refreshes during app updates with text such as 42 entities.

The plugin requires CorePlugin to provide the app’s default world. Register that dependency before this plugin; it is not added automatically.

Examples

import { App } from '@wimaengine/app'
import { CorePlugin } from '@wimaengine/core'
import { EntityCountDiagnosticPlugin } from '@wimaengine/diagnostic'
import { ReflectPlugin } from '@wimaengine/reflect'

new App()
  .registerPlugin(new ReflectPlugin())
  .registerPlugin(new CorePlugin())
  .registerDebugger(new EntityCountDiagnosticPlugin())
  .run()

Constructor


constructor()

Methods


register(app: App): void

View source

Installs the entity-count overlay for the app’s default world.

The overlay is appended to document.body and refreshed during app updates.

Parameters

NameDescriptionDefault
app

App to configure.

—

requires(): TypeId[]

View source

Returns the plugin dependency required by this diagnostic.

The returned ID identifies CorePlugin, which provides the app’s default world. The app validates this dependency but does not install it automatically.

Returns

Required plugin TypeId values.