feat(physics-rapier2d): 添加跨平台WASM加载器
This commit is contained in:
@@ -4,28 +4,29 @@
|
||||
* 编辑器版本的物理插件,不包含 WASM 依赖。
|
||||
* Editor version of physics plugin, without WASM dependencies.
|
||||
*
|
||||
* 用于编辑器中注册插件描述符,但不创建运行时模块。
|
||||
* 用于编辑器中注册插件清单,但不创建运行时模块。
|
||||
* 运行时使用 PhysicsPlugin from '@esengine/physics-rapier2d/runtime'
|
||||
*/
|
||||
|
||||
import type { IPlugin, PluginDescriptor } from '@esengine/engine-core';
|
||||
import type { IPlugin, ModuleManifest } from '@esengine/engine-core';
|
||||
|
||||
const descriptor: PluginDescriptor = {
|
||||
const manifest: ModuleManifest = {
|
||||
id: '@esengine/physics-rapier2d',
|
||||
name: 'Physics 2D',
|
||||
name: '@esengine/physics-rapier2d',
|
||||
displayName: 'Physics 2D',
|
||||
version: '1.0.0',
|
||||
description: 'Deterministic 2D physics with Rapier2D',
|
||||
category: 'physics',
|
||||
enabledByDefault: false,
|
||||
category: 'Physics',
|
||||
isCore: false,
|
||||
defaultEnabled: false,
|
||||
isEngineModule: true,
|
||||
canContainContent: false,
|
||||
isEnginePlugin: true,
|
||||
modules: [
|
||||
{
|
||||
name: 'PhysicsRuntime',
|
||||
type: 'runtime',
|
||||
loadingPhase: 'default'
|
||||
}
|
||||
]
|
||||
requiresWasm: true,
|
||||
dependencies: ['engine-core'],
|
||||
exports: {
|
||||
components: ['Rigidbody2DComponent', 'BoxCollider2DComponent', 'CircleCollider2DComponent'],
|
||||
systems: ['PhysicsSystem']
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -35,6 +36,6 @@ const descriptor: PluginDescriptor = {
|
||||
* 编辑器使用此版本注册插件,运行时使用带 WASM 的完整版本。
|
||||
*/
|
||||
export const Physics2DPlugin: IPlugin = {
|
||||
descriptor
|
||||
manifest
|
||||
// No runtime module - editor doesn't need physics simulation
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user