Base class for asset kinds backed by a file, such as a texture or a sound.
A kind implements MediaAsset.fetchResource and, if the resource needs
cleanup, MediaAsset.disposeResource. The engine loads every media asset
that the configuration references in an asset field before the scene starts.
Code that takes an asset by id on its own loads it through Assets:
Assets.acquire to wait until it is ready, or Assets.ensure to
start loading it when it is needed.
Example
consttexture = this.assets.get(Texture, id); texture?.resource; // the loaded resource, or undefined
Base class for asset kinds backed by a file, such as a texture or a sound.
A kind implements MediaAsset.fetchResource and, if the resource needs cleanup, MediaAsset.disposeResource. The engine loads every media asset that the configuration references in an
assetfield before the scene starts. Code that takes an asset by id on its own loads it through Assets: Assets.acquire to wait until it is ready, or Assets.ensure to start loading it when it is needed.Example