fix(editor): 修复右键菜单和粒子编辑器问题 (#286)
- 修复右键菜单被状态栏遮挡的问题 - 修复右键菜单边界检测,考虑标题栏和状态栏高度 - 调整右键菜单结构:新建文件夹 → 资源类型 → 工具操作 - 修复 Particle 插件默认未启用的问题(defaultEnabled 的新插件不被旧配置禁用) - 修复 SizeOverLifetime 模块在预览中无效果的问题 - 移除 MaterialEditorModule 中的重复模板注册
This commit is contained in:
@@ -1076,8 +1076,15 @@ export class PluginManager implements IService {
|
||||
continue; // 核心插件始终启用
|
||||
}
|
||||
|
||||
const shouldBeEnabled = enabledPlugins.includes(id);
|
||||
const inConfig = enabledPlugins.includes(id);
|
||||
const wasEnabled = plugin.enabled;
|
||||
const isDefaultEnabled = plugin.plugin.manifest.defaultEnabled;
|
||||
|
||||
// 如果插件在配置中明确列出,按配置来
|
||||
// 如果插件不在配置中但 defaultEnabled=true,保持启用(新插件不应被旧配置禁用)
|
||||
// If plugin is explicitly in config, follow config
|
||||
// If plugin is not in config but defaultEnabled=true, keep enabled (new plugins should not be disabled by old config)
|
||||
const shouldBeEnabled = inConfig || (isDefaultEnabled && !enabledPlugins.some(p => p === id));
|
||||
|
||||
if (shouldBeEnabled && !wasEnabled) {
|
||||
toEnable.push(id);
|
||||
|
||||
Reference in New Issue
Block a user