BasicMaterialAssets

View source

ExtendsAssets

Typed resource alias for the shared Assets pool of BasicMaterial assets. It inherits Assets behavior, including Assets#add and Assets#get, for storing and resolving material handles. RenderCorePlugin registers the pool for access through world.getResource and BasicMaterialAssets.

Examples

import { BasicMaterialAssets } from '@wimaengine/render-core'

function lookupMaterial(world, materialHandle) {
  const materials = world.getResource(BasicMaterialAssets)
  return materials.get(materialHandle)
}

Constructor


constructor(type: object)

View source

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.

Parameters

NameDescriptionDefault
type

Constructor for the asset values in this container.

—