Skip to content

@relu-interactives/spatial-ecs


@relu-interactives/spatial-ecs / index / getLoadedAsset

Function: getLoadedAsset() ​

ts
function getLoadedAsset<T>(source): T | undefined;

Defined in: assets/runtimeAssets.ts:354

A loaded file, or undefined if it isn't ready: a GLTF for a model, a THREE.Texture for an image, a PrefabAsset for a prefab, an ArrayBuffer for anything else.

A model's scene is shared: mount a clone, never the scene itself. A texture reads as data until you say otherwise: set colorSpace for a colour map.

Type Parameters ​

Type ParameterDefault type
Tunknown

Parameters ​

ParameterType
sourceAssetSource

Returns ​

T | undefined