TimePlugin

View source

ExtendsPlugin

Adds virtual time and timer progression to an App.

TimePlugin provides a fresh VirtualClock resource and advances Timer components from the clock’s current frame duration. This gives application code one shared, controllable source of virtual time.

The plugin depends on CorePlugin and ReflectPlugin. Register both before TimePlugin; plugin dependencies are checked but are not installed automatically.

Examples

import { App } from '@wimaengine/app'
import { CorePlugin } from '@wimaengine/core'
import { ReflectPlugin } from '@wimaengine/reflect'
import { TimePlugin } from '@wimaengine/time'

new App()
  .registerPlugin(new ReflectPlugin())
  .registerPlugin(new CorePlugin())
  .registerPlugin(new TimePlugin())
  .run()

Constructor


constructor()

Methods


register(app: App): void

View source

Installs the app’s VirtualClock and connects timer progression to the app’s virtual time.

Parameters

NameDescriptionDefault
app

App to configure.

—