constructor(type: object)
View sourceCreates a typed asset pool for values identified by type.
The supplied constructor is retained as the asset family’s type identity for handles and resource access.
Class
ExtendsAssets
Typed resource alias for the shared Assets pool of Audio
assets. It inherits Assets behavior, including Assets#add
and Assets#get, for storing and resolving audio handles.
AudioPlugin registers this alias for the shared audio pool; it does
not create a second store. Retrieve the pool with world.getResource and
AudioAssets.
import { AudioAssets } from '@wimaengine/audio'
function lookupAudio(world, audioHandle) {
const audioAssets = world.getResource(AudioAssets)
const audio = audioAssets.get(audioHandle)
// AudioAssets resolves this handle from the shared pool.
return audio?.audiobuffer
}constructor(type: object)Creates a typed asset pool for values identified by type.
The supplied constructor is retained as the asset family’s type identity for handles and resource access.