b28169b186
* docs: add editor-app README with setup instructions * docs: add separate EN/CN editor setup guides * fix(editor): fix build errors and refactor behavior-tree architecture - Fix fairygui-editor tsconfig extends path and add missing tsconfig.build.json - Refactor behavior-tree-editor to not depend on asset-system in runtime - Create local BehaviorTreeRuntimeModule for pure runtime logic - Move asset loader registration to editor module install() - Add BehaviorTreeLoader for asset system integration - Fix rapier2d WASM loader to not pass arguments to init() - Add WASM base64 loader config to rapier2d tsup.config - Update README documentation and simplify setup steps
13 lines
357 B
TypeScript
13 lines
357 B
TypeScript
// @ts-ignore
|
|
import wasmBase64 from "../pkg/rapier_wasm2d_bg.wasm";
|
|
import wasmInit from "../pkg/rapier_wasm2d";
|
|
import base64 from "base64-js";
|
|
|
|
/**
|
|
* Initializes RAPIER.
|
|
* Has to be called and awaited before using any library methods.
|
|
*/
|
|
export async function init() {
|
|
await wasmInit(base64.toByteArray(wasmBase64 as unknown as string).buffer);
|
|
}
|