@modoki/engine / index / registerTrait
Function: registerTrait()
registerTrait(
meta):void
Register a koota trait's editor/serialization metadata — call this once per trait, typically right after trait({ ... }) defines it, so the Inspector can auto-generate fields and the scene/prefab loaders can serialize it generically. Without registering a trait it still works as a plain koota trait (you can add/query/remove it), but it won't show up in the Inspector's "Add Component" menu and won't round-trip through scene JSON — registration is what makes a hand-defined trait a first-class citizen of the rest of the engine (serialization, hot-reload identity, editor tooling).
Safe to call again for the same name (e.g. on script hot-reload re-importing the trait module, which produces a NEW koota Trait object) — the prior entry for that name is evicted first so the registry never accumulates a stale, orphaned duplicate.
Parameters
meta
Returns
void