Class
HierarchyPlugin
View sourceExtendsPlugin
Adds synchronized parent/child hierarchy behavior to an App.
Use Children and Parent to describe an entity hierarchy.
Adding Children adds or updates each child’s Parent;
adding Parent adds the child to its parent’s Children.
Removing a Parent removes the child from its parent’s list, and
despawning an entity with Children recursively despawns its listed
children. These relationships stay synchronized when the corresponding
components change; the plugin does not create hierarchy entities for you.
Register CorePlugin and ReflectPlugin before
HierarchyPlugin. The app validates these dependencies but does not
install missing plugins automatically.
Examples
import { App } from '@wimaengine/app'
import { CorePlugin } from '@wimaengine/core'
import { HierarchyPlugin } from '@wimaengine/hierarchy'
import { ReflectPlugin } from '@wimaengine/reflect'
new App()
.registerPlugin(new ReflectPlugin())
.registerPlugin(new CorePlugin())
.registerPlugin(new HierarchyPlugin())
.run()
// Children and Parent relationships stay synchronized as entities change.Constructor
Methods
register(app: App): void
View sourcerequires(): TypeId[]
View sourceReturns the type IDs for the plugins required by this plugin.
The app must already have CorePlugin and
ReflectPlugin registered; this plugin does not install missing
dependencies automatically.
