RuntimeAssetSource
此内容尚不支持你的语言。
Defined in: runtime/runtimeAssets.ts:33
How a target supplies scene assets to the single Assets channel, built from
canonical parts instead of a bespoke provider:
backend— canonical fetch (text/binary, incl. KTX2 containers)decodePixels— platform image → RGBA (URL<img>can’t reachestella:/// WeChat package files / inlined data-URLs);flipis applied on upload viacreateTextureFromPixels, so decoders return top-first and ignore itresolveRef— ref → resolved (extension-bearing) path; must run before theTextureLoaderKTX2 extension check, so uuid/manifest lookup lives HERE, not inbackend.resolveUrl. Omit for identity. (Signature declared locally, not imported from TextureLoader — that module imports from this one, so importing back would cycle.)
Properties
Section titled “Properties”backend
Section titled “backend”backend:
Backend
Defined in: runtime/runtimeAssets.ts:34
Methods
Section titled “Methods”decodePixels()
Section titled “decodePixels()”decodePixels(
path,flip):Promise<{height:number;pixels:Uint8Array;width:number; }>
Defined in: runtime/runtimeAssets.ts:35
Parameters
Section titled “Parameters”string
boolean
Returns
Section titled “Returns”Promise<{ height: number; pixels: Uint8Array; width: number; }>
listAssetPaths()?
Section titled “listAssetPaths()?”
optionallistAssetPaths():string[]
Defined in: runtime/runtimeAssets.ts:53
Every asset path this realm ships (logical, extension-bearing). Powers
content-driven discovery of assets NO scene references — locale string
tables (.eslocale), which Text binds by KEY, not path. Optional: a
realm without it simply can’t auto-load such assets (the runtime loader
warns when a scene needs them).
Returns
Section titled “Returns”string[]
resolveAddress()?
Section titled “resolveAddress()?”
optionalresolveAddress(ref):string|null
Defined in: runtime/runtimeAssets.ts:45
The LOGICAL source path a ref was authored at (e.g. assets/spine/hero.atlas),
even after a content-addressed build renamed the physical file to a hash. A
loader that resolves a SIBLING by name — a Spine atlas naming its page PNG
relative to itself — needs the logical directory, which resolveRef (a build
path) has lost. Optional: a realm that stages under logical paths has nothing
to recover, and a caller falls back to the resolved path.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”string | null
resolveRef()?
Section titled “resolveRef()?”
optionalresolveRef(ref):string
Defined in: runtime/runtimeAssets.ts:36
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”string
spineCulling()?
Section titled “spineCulling()?”
optionalspineCulling(skeleton,atlas): {height:number;width:number;x:number;y:number; } |undefined
Defined in: runtime/runtimeAssets.ts:69
The rectangle no pose of this spine PAIR leaves, in the skeleton’s own space. Both refs, since an atlas the promise was not recorded against inherits nothing; a realm without this certifies nothing.
Parameters
Section titled “Parameters”skeleton
Section titled “skeleton”string
string
Returns
Section titled “Returns”{ height: number; width: number; x: number; y: number; } | undefined
textureImportSettings()?
Section titled “textureImportSettings()?”
optionaltextureImportSettings(ref):ParsedTextureImportSettings|undefined
Defined in: runtime/runtimeAssets.ts:65
Per-texture import settings (filter/wrap/sRGB and the 9-slice border) for a
ref. These belong to the ASSET, not to any scene that uses it, which is why
they arrive through the realm’s source alongside resolveRef rather than
being copied into every scene that references the texture — a copy in the
scene goes stale the moment the .meta changes.
Optional: a realm without it renders with loader defaults. Each realm has
the data already — the editor from its asset database, a cooked build from
the importer block the cook copies into the ship manifest.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”ParsedTextureImportSettings | undefined