Skip to main content

Addressable Loading

tip

Using Addressable Loading requires the Unity Addressable Asset System.

Addressable loading is an optional feature of Wasmbox which automatically handles the process of loading a WasmAsset. To use it, Addressables must be installed from the package manager.

Once Addressables is installed, Addressable Loading must be enabled in the importer. This generates a CreateAsync method on the autogenerated code.

EngineConfig Config = EngineConfig.Default;

var wrapper = await TheAutogeneratedWrapper.CreateAsync(Config);

wrapper.CallSomeCode();

This code is all that is required to create an instance of a wrapper (named TheAutogeneratedWrapper in this example).

An EngineConfig is required to set how the WASM is compiled into machine code. The EngineConfig.Default is suitable for most use cases but some features (e.g. Resource Limits) must be enabled in the EngineConfig.