diff --git a/editor/engine-features/render-config.json b/editor/engine-features/render-config.json index da68694325c..bb3bf9ca6ee 100644 --- a/editor/engine-features/render-config.json +++ b/editor/engine-features/render-config.json @@ -103,7 +103,15 @@ "label": "i18n:ENGINE.features.physics_ammo.label", "description": "i18n:ENGINE.features.physics_ammo.description", "default": true, - "isNativeModule": true + "isNativeModule": true, + "flags": { + "LOAD_BULLET_MANUALLY": { + "label": "i18n:ENGINE.features.flags.bullet.loadManual.label", + "description": "i18n:ENGINE.features.flags.bullet.loadManual.description", + "default": false, + "ui-type": "checkbox" + } + } }, "physics-cannon": { "label": "i18n:ENGINE.features.physics_cannon.label", @@ -113,7 +121,15 @@ "label": "i18n:ENGINE.features.physics_physx.label", "cmakeConfig": "USE_PHYSICS_PHYSX", "description": "i18n:ENGINE.features.physics_physx.description", - "isNativeModule": true + "isNativeModule": true, + "flags": { + "LOAD_PHYSX_MANUALLY": { + "label": "i18n:ENGINE.features.flags.physx.loadManual.label", + "description": "i18n:ENGINE.features.flags.physx.loadManual.description", + "default": false, + "ui-type": "checkbox" + } + } }, "physics-builtin": { "label": "i18n:ENGINE.features.physics_builtin.label", @@ -293,7 +309,15 @@ "category": "2d", "dependencies": [ "2d" - ] + ], + "flags": { + "LOAD_SPINE_MANUALLY": { + "label": "i18n:ENGINE.features.flags.spine.loadManual.label", + "description": "i18n:ENGINE.features.flags.spine.loadManual.description", + "ui-type": "checkbox", + "default": false + } + } }, "dragon-bones": { "default": true, diff --git a/editor/engine-features/schema.json b/editor/engine-features/schema.json index 2c98729797d..2d3b81a5a37 100644 --- a/editor/engine-features/schema.json +++ b/editor/engine-features/schema.json @@ -40,6 +40,9 @@ }, "required": { "type": "boolean" + }, + "flags": { + "type": "object" } }, "type": "object" @@ -241,6 +244,9 @@ }, "required": { "type": "boolean" + }, + "flags": { + "type": "object" } }, "type": "object" diff --git a/editor/engine-features/types.ts b/editor/engine-features/types.ts index 2f6a7114b94..fe94c8c6d6c 100644 --- a/editor/engine-features/types.ts +++ b/editor/engine-features/types.ts @@ -94,6 +94,12 @@ export interface BaseItem { * @en Whether it is a required module. When adding a new module, the old version will be forced to select this module after the upgrade, otherwise it will not be selected. */ required?: boolean; + + /** + * @zh 当选择了某个模块时,可以做些附加的配置 + * @en When a module is selected, additional configurations can be made + */ + flags: {[k: string]: Pick & {'ui-type': 'checkbox' | 'select'}} } export interface IFeatureItem extends BaseItem { diff --git a/editor/i18n/en/localization.js b/editor/i18n/en/localization.js index 89406e3b88d..1b9f07c7e4c 100755 --- a/editor/i18n/en/localization.js +++ b/editor/i18n/en/localization.js @@ -1101,6 +1101,32 @@ module.exports = link(mixin({ label: "WebSocket Server", description: "Enable WebSocket Server for native. Note: WebSocket must also be enabled.", }, + flags: { + spine: { + loadManual: { + label: 'Load Manually', + description: `Whether to load Spine Wasm/AsmJS moudle manually by 'loadWasmModuleSpine' API ?`, + }, + }, + box2d: { + loadManual: { + label: 'Load Manually', + description: `Whether to load Box2D Wasm/AsmJS moudle manually by 'loadWasmModuleBox2D' API ?`, + }, + }, + bullet: { + loadManual: { + label: 'Load Manually', + description: `Whether to load Bullet Wasm/AsmJS moudle manually by 'loadWasmModuleBullet' API ?`, + }, + }, + physx: { + loadManual: { + label: 'Load Manually', + description: `Whether to load PhysX Wasm/AsmJS moudle manually by 'loadWasmModulePhysX' API ?`, + }, + }, + }, }, renderable_2d: { srcBlendFactor: 'Specifies the source blend mode,
it will clone a new material object.', diff --git a/editor/i18n/zh/localization.js b/editor/i18n/zh/localization.js index 6b0adfc164e..9b68c2c0c19 100755 --- a/editor/i18n/zh/localization.js +++ b/editor/i18n/zh/localization.js @@ -1079,6 +1079,32 @@ module.exports = link(mixin({ label: "WebSocket Server", description: "对原生启用 WebSocket Server。注意: 必须同时启用 WebSocket。", }, + flags: { + spine: { + loadManual: { + label: '手动加载', + description: `是否通过 'loadWasmModuleSpine' API 手动加载 Spine Wasm/AsmJS 模块 ?`, + }, + }, + box2d: { + loadManual: { + label: '手动加载', + description: `是否通过 'loadWasmModuleBox2D' API 手动加载 Box2D Wasm/AsmJS 模块 ?`, + }, + }, + bullet: { + loadManual: { + label: '手动加载', + description: `是否通过 'loadWasmModuleBullet' API 手动加载 Bullet Wasm/AsmJS 模块 ?`, + }, + }, + physx: { + loadManual: { + label: '手动加载', + description: `是否通过 'loadWasmModulePhysX' API 手动加载 PhysX Wasm/AsmJS 模块 ?`, + }, + }, + }, }, renderable_2d: { srcBlendFactor: '指定源的混合模式,这会克隆一个新的材质对象,注意这带来的性能和内存损耗',