IWasmAsset
IWasmAsset
is an interface which represents a source which a Module
can be loaded from. Built in implementations include WasmAsset
(imported through the editor) and DynamicWasmAsset
(loaded at runtime).
Properties​
string? CacheKey
​
When a LoadedModule
is created from this WASM asset it is cached in memory with this value and the EngineConfig
as the key. Any future loads of any asset with the same key & EngineConfig
will use this cached value. Return null
to disable caching entirely.
caution
Creating multiple WasmAsset
s with the same CacheKey
but different WASM/WAT code will lead to unpredictable behaviour!
Methods​
Module? LoadModule(Engine engine);
​
Attempt to load a Module
from this asset. Return null
if the load fails for any reason.