WASM Asset
A WasmAsset
is a WASM module which has been imported in the editor from a *.wasm
or *.wat
file and converted into a form ready to load at runtime. For WasmAsset
editor/inspector documentation see here.
It is also possible to load a WASM module at runtime from a byte[]
or string
(DynamicWasmAsset
) or to create a completely custom WASM asset type (IWasmAsset
).
Instantiating A WASM Asset​
A WASM Asset must be loaded into memory and then instantiated to run WASM code. There are several ways to do this:
- SimpleWasmMonoBehaviour: handles the entire process inside a standard
MonoBehaviour
wrapper. - Addressables: Uses Addressables to load the WASM asset.
- Manual Loading: do the entire process in your own code, giving you complete control.
Properties​
Metadata
​
Contains metadata about the WASM module this asset contains; lists of all imported and exported memories, globals, tables and functions.
This allows inspecting the dependencies of a WASM module without instantiating the module itself.