Crate bevy_wasm_scripting
source ·Structs
- The
WasmScriptComponentEnv
is the primary entry point for running scripts associated with components on entities. - The
WasmScriptEnv
is another entry point for running scripts, similar toWasmScriptComponentEnv
. It works for all scripts, and in situations whereWasmScriptComponentEnv
will not (multiple scripts in one system, resource-based scripts). - The
WasmScriptResourceEnv
is the primary entry point for running scripts associated with resources. - The
WasmerStore
is an essential item for the use of wasm scripts. However, it should not be referenced directly by systems.WasmScriptEnv
,WasmScriptComponentEnv
, andWasmScriptResourceEnv
are better entry points for running scripts.
Enums
- A WasmScript assets represented a single, eventually-instantiated WASM script. All WasmScript assets are automatically compiled by the compile_wasm_scripts system, and may come from .wat or .wasm files. Ideally, scripts should be loaded early so they can be compiled during a loading stage. Compilation can take some time.
Traits
- The WasmScriptComponent represents the configuration point for component-based scripts. A WasmScriptComponent should have an associated handle, which is returned by
get_wasm_script_handle
. WasmScriptResource
is similar toWasmScriptComponent
. You can register a resource with a single associated script, usingadd_wasm_script_resource
.
Functions
- Add this system to automatically instantiate a script attached to a resource instead of a component. This will work well with hot reloading, as asset modifications are listened for.