* feat(prefab): 实现预制体系统和编辑器 UX 改进 ## 预制体系统 - 新增 PrefabSerializer: 预制体序列化/反序列化 - 新增 PrefabInstanceComponent: 追踪预制体实例来源和修改 - 新增 PrefabService: 预制体核心服务 - 新增 PrefabLoader: 预制体资产加载器 - 新增预制体命令: Create/Instantiate/Apply/Revert/BreakLink ## 预制体编辑模式 - 支持双击 .prefab 文件进入编辑模式 - 预制体编辑模式工具栏 (保存/退出) - 预制体实例指示器和操作菜单 ## 编辑器 UX 改进 - SceneHierarchy 快捷键: F2 重命名, Ctrl+D 复制, ↑↓ 导航 - 支持双击实体名称内联编辑 - 删除实体时显示子节点数量警告 - 右键菜单添加重命名/复制选项及快捷键提示 - 布局持久化和重置功能 ## Bug 修复 - 修复 editor-runtime 组件类重复导致的 TransformComponent 不识别问题 - 修复 .prefab-name 样式覆盖导致预制体工具栏文字不可见 - 修复 Inspector 资源字段高度不正确问题 * feat(editor): 改进编辑器 UX 交互体验 - ContentBrowser: 加载动画 spinner、搜索高亮、改进空状态设计 - SceneHierarchy: 选中项自动滚动到视图、搜索清除按钮 - PropertyInspector: 输入框本地状态管理、Enter/Escape 键处理 - EntityInspector: 组件折叠状态持久化、属性搜索清除按钮 - Viewport: 变换操作实时数值显示 - 国际化: 添加相关文本 (en/zh) * fix(build): 修复 Web 构建资产加载和编辑器 UX 改进 构建系统修复: - 修复 asset-catalog.json 字段名不匹配 (entries vs assets) - 修复 BrowserFileSystemService 支持两种目录格式 - 修复 bundle 策略检测逻辑 (空对象判断) - 修复 module.json 中 assetExtensions 声明和类型推断 行为树修复: - 修复 BehaviorTreeExecutionSystem 使用 loadAsset 替代 loadAssetByPath - 修复 BehaviorTreeAssetType 常量与 module.json 类型名一致 (behavior-tree) 编辑器 UX 改进: - 构建完成对话框添加"打开文件夹"按钮 - 构建完成对话框样式优化 (圆形图标背景、按钮布局) - SceneHierarchy 响应式布局 (窄窗口自动隐藏 Type 列) - SceneHierarchy 隐藏滚动条 错误追踪: - 添加全局错误处理器写入日志文件 (%TEMP%/esengine-editor-crash.log) - 添加 append_to_log Tauri 命令 * feat(render): 修复 UI 渲染和点击特效系统 ## UI 渲染修复 - 修复 GUID 验证 bug,使用统一的 isValidGUID() 函数 - 修复 UI 渲染顺序随机问题,Rust 端使用 IndexMap 替代 HashMap - Web 运行时添加 assetPathResolver 支持 GUID 解析 - UIInteractableComponent.blockEvents 默认值改为 false ## 点击特效系统 - 新增 ClickFxComponent 和 ClickFxSystem - 支持在点击位置播放粒子效果 - 支持多种触发模式和粒子轮换 ## Camera 系统重构 - CameraSystem 从 ecs-engine-bindgen 移至 camera 包 - 新增 CameraManager 统一管理相机 ## 编辑器改进 - 改进属性面板 UI 交互 - 粒子编辑器面板优化 - Transform 命令系统 * feat(render): 实现 Sorting Layer 系统和 Overlay 渲染层 - 新增 SortingLayerManager 管理排序层级 (Background, Default, Foreground, UI, Overlay) - 实现 ISortable 接口,统一 Sprite、UI、Particle 的排序属性 - 修复粒子 Overlay 层被 UI 遮挡问题:添加独立的 Overlay Pass 在 UI 之后渲染 - 更新粒子资产格式:从 sortingOrder 改为 sortingLayer + orderInLayer - 更新粒子编辑器面板支持新的排序属性 - 优化 UI 渲染系统使用新的排序层级 * feat(ci): 集成 SignPath 代码签名服务 - 添加 SignPath 自动签名工作流(Windows) - 配置 release-editor.yml 支持代码签名 - 将构建改为草稿模式,等待签名完成后发布 - 添加证书文件到 .gitignore 防止泄露 * fix(asset): 修复 Web 构建资产路径解析和全局单例移除 ## 资产路径修复 - 修复 Tauri 本地服务器 `/asset?path=...` 路径解析,正确与 root 目录连接 - BrowserPathResolver 支持两种模式: - 'proxy': 使用 /asset?path=... 格式(编辑器 Run in Browser) - 'direct': 使用直接路径 /assets/path.png(独立 Web 构建) - BrowserRuntime 使用 'direct' 模式,无需 Tauri 代理 ## 架构改进 - 移除全局单例 - 移除 globalAssetManager 导出,改用 AssetManagerToken 依赖注入 - 移除 globalPathResolver 导出,改用 PathResolutionService - 移除 globalPathResolutionService 导出 - ParticleUpdateSystem/ClickFxSystem 通过 setAssetManager() 注入依赖 - EngineService 使用 new AssetManager() 替代全局实例 ## 新增服务 - PathResolutionService: 统一路径解析接口 - RuntimeModeService: 运行时模式查询服务 - SerializationContext: EntityRef 序列化上下文 ## 其他改进 - 完善 ServiceToken 注释说明本地定义的意图 - 导出 BrowserPathResolveMode 类型 * fix(build): 添加 world-streaming composite 设置修复类型检查 * fix(build): 移除 world-streaming 引用避免 composite 冲突 * fix(build): 将 const enum 改为 enum 兼容 isolatedModules * fix(build): 添加缺失的 IAssetManager 导入
1444 lines
26 KiB
CSS
1444 lines
26 KiB
CSS
.entity-inspector {
|
|
display: flex;
|
|
flex-direction: column;
|
|
height: 100%;
|
|
background-color: #262626;
|
|
color: #ccc;
|
|
position: relative;
|
|
font-size: 11px;
|
|
}
|
|
|
|
.inspector-header {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
height: 24px;
|
|
padding: 0 6px;
|
|
border-bottom: 1px solid #1a1a1a;
|
|
background-color: #2d2d2d;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.inspector-header-left {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 4px;
|
|
flex: 1;
|
|
}
|
|
|
|
.inspector-lock-btn {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 16px;
|
|
height: 16px;
|
|
background: transparent;
|
|
border: none;
|
|
color: #666;
|
|
cursor: pointer;
|
|
padding: 0;
|
|
}
|
|
|
|
.inspector-lock-btn:hover {
|
|
color: #999;
|
|
}
|
|
|
|
.inspector-lock-btn.locked {
|
|
color: #f59e0b;
|
|
}
|
|
|
|
.inspector-object-count {
|
|
font-size: 11px;
|
|
color: #888;
|
|
margin-left: auto;
|
|
}
|
|
|
|
.inspector-header-icon {
|
|
color: var(--color-text-secondary);
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.inspector-header h3 {
|
|
margin: 0;
|
|
font-size: var(--font-size-sm);
|
|
font-weight: var(--font-weight-semibold);
|
|
color: var(--color-text-primary);
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.05em;
|
|
}
|
|
|
|
/* Search Box */
|
|
.inspector-search {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 4px;
|
|
padding: 2px 6px;
|
|
background: #262626;
|
|
border-bottom: 1px solid #1a1a1a;
|
|
}
|
|
|
|
.inspector-search svg {
|
|
color: #555;
|
|
flex-shrink: 0;
|
|
width: 12px;
|
|
height: 12px;
|
|
}
|
|
|
|
.inspector-search input {
|
|
flex: 1;
|
|
background: #1e1e1e;
|
|
border: 1px solid #3a3a3a;
|
|
border-radius: 2px;
|
|
padding: 2px 6px;
|
|
font-size: 11px;
|
|
color: #ccc;
|
|
height: 18px;
|
|
}
|
|
|
|
.inspector-search input:focus {
|
|
outline: none;
|
|
border-color: #4a9eff;
|
|
}
|
|
|
|
.inspector-search input::placeholder {
|
|
color: #555;
|
|
}
|
|
|
|
.inspector-search-clear {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: 2px;
|
|
background: transparent;
|
|
border: none;
|
|
color: #666;
|
|
cursor: pointer;
|
|
border-radius: 2px;
|
|
transition: all 0.15s ease;
|
|
}
|
|
|
|
.inspector-search-clear:hover {
|
|
background: rgba(255, 255, 255, 0.1);
|
|
color: #fff;
|
|
}
|
|
|
|
.inspector-search-count {
|
|
font-size: 10px;
|
|
color: #666;
|
|
white-space: nowrap;
|
|
padding: 0 4px;
|
|
}
|
|
|
|
/* Category Tabs */
|
|
.inspector-category-tabs {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: 2px;
|
|
padding: 2px 6px;
|
|
background: #262626;
|
|
border-bottom: 1px solid #1a1a1a;
|
|
}
|
|
|
|
.inspector-category-tab {
|
|
padding: 1px 6px;
|
|
font-size: 10px;
|
|
font-weight: 400;
|
|
color: #888;
|
|
background: transparent;
|
|
border: 1px solid #333;
|
|
border-radius: 2px;
|
|
cursor: pointer;
|
|
transition: all 0.1s ease;
|
|
height: 18px;
|
|
}
|
|
|
|
.inspector-category-tab:hover {
|
|
background: #333;
|
|
color: #ccc;
|
|
}
|
|
|
|
.inspector-category-tab.active {
|
|
background: #3b82f6;
|
|
border-color: #3b82f6;
|
|
color: #fff;
|
|
}
|
|
|
|
.inspector-content {
|
|
flex: 1;
|
|
display: flex;
|
|
flex-direction: column;
|
|
overflow-y: auto;
|
|
overflow-x: hidden;
|
|
padding: 0;
|
|
min-height: 0;
|
|
}
|
|
|
|
.inspector-content::-webkit-scrollbar {
|
|
width: 8px;
|
|
height: 8px;
|
|
}
|
|
|
|
.inspector-content::-webkit-scrollbar-track {
|
|
background: var(--color-bg-base);
|
|
}
|
|
|
|
.inspector-content::-webkit-scrollbar-thumb {
|
|
background: rgba(121, 121, 121, 0.4);
|
|
border-radius: 4px;
|
|
}
|
|
|
|
.inspector-content::-webkit-scrollbar-thumb:hover {
|
|
background: rgba(100, 100, 100, 0.7);
|
|
}
|
|
|
|
.inspector-content::-webkit-scrollbar-corner {
|
|
background: transparent;
|
|
}
|
|
|
|
.inspector-section {
|
|
margin-bottom: 0;
|
|
padding: 0;
|
|
background-color: transparent;
|
|
border-radius: 0;
|
|
}
|
|
|
|
.section-header {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: var(--spacing-sm);
|
|
font-size: var(--font-size-xs);
|
|
font-weight: var(--font-weight-semibold);
|
|
color: var(--color-text-secondary);
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.05em;
|
|
margin-bottom: var(--spacing-sm);
|
|
padding-bottom: var(--spacing-xs);
|
|
border-bottom: 1px solid var(--color-border-subtle);
|
|
}
|
|
|
|
.section-icon {
|
|
color: var(--color-text-tertiary);
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.section-header span {
|
|
flex: 1;
|
|
}
|
|
|
|
.add-component-btn {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 20px;
|
|
height: 20px;
|
|
background-color: var(--color-primary);
|
|
color: var(--color-text-inverse);
|
|
border: none;
|
|
border-radius: var(--radius-sm);
|
|
cursor: pointer;
|
|
transition: all var(--transition-fast);
|
|
}
|
|
|
|
.add-component-btn:hover {
|
|
background-color: var(--color-primary-hover);
|
|
transform: scale(1.1);
|
|
}
|
|
|
|
.add-component-btn:active {
|
|
transform: scale(0.95);
|
|
}
|
|
|
|
.section-content {
|
|
padding: 0;
|
|
}
|
|
|
|
.info-row {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
padding: var(--spacing-xs) var(--spacing-sm);
|
|
font-size: var(--font-size-base);
|
|
border-radius: var(--radius-sm);
|
|
transition: background-color var(--transition-fast);
|
|
}
|
|
|
|
.info-row:hover {
|
|
background-color: var(--color-bg-hover);
|
|
}
|
|
|
|
.info-label {
|
|
color: var(--color-text-secondary);
|
|
font-weight: var(--font-weight-medium);
|
|
font-size: var(--font-size-sm);
|
|
}
|
|
|
|
.info-value {
|
|
color: var(--color-text-primary);
|
|
font-size: var(--font-size-sm);
|
|
font-family: var(--font-family-mono);
|
|
}
|
|
|
|
.component-list {
|
|
list-style: none;
|
|
margin: 0;
|
|
padding: 0;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: var(--spacing-sm);
|
|
min-height: min-content;
|
|
}
|
|
|
|
.component-item {
|
|
background: linear-gradient(135deg, var(--color-bg-elevated) 0%, var(--color-bg-base) 100%);
|
|
border: 1px solid var(--color-border-default);
|
|
border-radius: var(--radius-md);
|
|
overflow: visible;
|
|
transition: all var(--transition-base);
|
|
display: flex;
|
|
flex-direction: column;
|
|
min-height: min-content;
|
|
}
|
|
|
|
.component-item:hover {
|
|
border-color: var(--color-border-strong);
|
|
box-shadow: var(--shadow-sm);
|
|
}
|
|
|
|
.component-item.expanded {
|
|
background: var(--color-bg-overlay);
|
|
box-shadow: var(--shadow-md);
|
|
overflow: visible;
|
|
}
|
|
|
|
.component-header {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: var(--spacing-sm);
|
|
padding: var(--spacing-sm) var(--spacing-md);
|
|
cursor: pointer;
|
|
transition: background-color var(--transition-fast);
|
|
user-select: none;
|
|
}
|
|
|
|
.component-header:hover {
|
|
background-color: var(--color-bg-hover);
|
|
}
|
|
|
|
.component-expand-btn {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
background: none;
|
|
border: none;
|
|
color: var(--color-text-secondary);
|
|
padding: 0;
|
|
cursor: pointer;
|
|
transition: all var(--transition-fast);
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.component-expand-btn:hover {
|
|
color: var(--color-primary);
|
|
transform: scale(1.1);
|
|
}
|
|
|
|
.component-icon {
|
|
display: flex;
|
|
align-items: center;
|
|
color: var(--color-text-secondary);
|
|
flex-shrink: 0;
|
|
transition: color var(--transition-fast);
|
|
}
|
|
|
|
.component-item:hover .component-icon,
|
|
.component-item.expanded .component-icon {
|
|
color: var(--color-primary);
|
|
}
|
|
|
|
.component-name {
|
|
flex: 1;
|
|
color: var(--color-text-primary);
|
|
font-size: var(--font-size-base);
|
|
font-weight: var(--font-weight-medium);
|
|
}
|
|
|
|
.remove-component-btn {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
background: none;
|
|
border: none;
|
|
color: var(--color-text-tertiary);
|
|
padding: var(--spacing-xs);
|
|
cursor: pointer;
|
|
border-radius: var(--radius-sm);
|
|
transition: all var(--transition-fast);
|
|
flex-shrink: 0;
|
|
opacity: 0;
|
|
}
|
|
|
|
.component-header:hover .remove-component-btn {
|
|
opacity: 1;
|
|
}
|
|
|
|
.remove-component-btn:hover {
|
|
background-color: var(--color-error);
|
|
color: var(--color-text-inverse);
|
|
transform: scale(1.1);
|
|
}
|
|
|
|
.remove-component-btn:active {
|
|
transform: scale(0.95);
|
|
}
|
|
|
|
.component-properties {
|
|
border-top: 1px solid var(--color-border-default);
|
|
background-color: var(--color-bg-base);
|
|
overflow: visible;
|
|
}
|
|
|
|
.empty-state {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: var(--spacing-4xl) var(--spacing-lg);
|
|
text-align: center;
|
|
color: var(--color-text-secondary);
|
|
height: 100%;
|
|
}
|
|
|
|
.empty-icon {
|
|
color: var(--color-text-tertiary);
|
|
margin-bottom: var(--spacing-md);
|
|
opacity: 0.5;
|
|
}
|
|
|
|
.empty-title {
|
|
font-size: var(--font-size-base);
|
|
font-weight: var(--font-weight-medium);
|
|
color: var(--color-text-secondary);
|
|
margin-bottom: var(--spacing-xs);
|
|
}
|
|
|
|
.empty-hint {
|
|
font-size: var(--font-size-sm);
|
|
color: var(--color-text-tertiary);
|
|
}
|
|
|
|
.empty-state-small {
|
|
padding: var(--spacing-lg);
|
|
text-align: center;
|
|
color: var(--color-text-tertiary);
|
|
font-size: var(--font-size-sm);
|
|
font-style: italic;
|
|
}
|
|
|
|
.entity-name {
|
|
font-size: 12px;
|
|
font-weight: 500;
|
|
color: var(--color-text-primary);
|
|
}
|
|
|
|
.section-title {
|
|
font-size: 10px;
|
|
font-weight: 600;
|
|
color: #888;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.08em;
|
|
margin: 0;
|
|
padding: 3px 6px;
|
|
background: rgba(0, 0, 0, 0.3);
|
|
border-radius: 0;
|
|
}
|
|
|
|
.property-field {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: flex-start;
|
|
padding: 4px 8px;
|
|
font-size: 11px;
|
|
gap: 8px;
|
|
background-color: transparent;
|
|
border-radius: 0;
|
|
margin-bottom: 1px;
|
|
min-height: 24px;
|
|
}
|
|
|
|
/* 简单字段(文本、数字等)垂直居中 | Simple fields (text, number, etc.) center vertically */
|
|
.property-field.simple-field {
|
|
align-items: center;
|
|
}
|
|
|
|
.property-field:last-child {
|
|
margin-bottom: 0;
|
|
}
|
|
|
|
.property-field:hover {
|
|
background-color: rgba(255, 255, 255, 0.03);
|
|
}
|
|
|
|
.property-label {
|
|
color: #888;
|
|
font-weight: 400;
|
|
flex-shrink: 0;
|
|
min-width: 70px;
|
|
font-size: 11px;
|
|
padding-top: 3px;
|
|
}
|
|
|
|
/* 简单字段的 label 不需要额外的 padding | Simple field labels don't need extra padding */
|
|
.property-field.simple-field .property-label {
|
|
padding-top: 0;
|
|
}
|
|
|
|
.property-value-text {
|
|
color: #ccc;
|
|
text-align: right;
|
|
word-break: break-word;
|
|
font-size: 11px;
|
|
flex: 1;
|
|
font-family: var(--font-family-mono);
|
|
}
|
|
|
|
.component-remove-btn {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
background: none;
|
|
border: none;
|
|
color: var(--color-text-tertiary);
|
|
padding: 4px;
|
|
cursor: pointer;
|
|
border-radius: 3px;
|
|
transition: all 0.15s;
|
|
flex-shrink: 0;
|
|
opacity: 0;
|
|
margin-left: auto;
|
|
}
|
|
|
|
.component-header:hover .component-remove-btn {
|
|
opacity: 1;
|
|
}
|
|
|
|
.component-remove-btn:hover {
|
|
background-color: var(--color-error);
|
|
color: white;
|
|
}
|
|
|
|
.empty-inspector {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: 48px 24px;
|
|
text-align: center;
|
|
height: 100%;
|
|
}
|
|
|
|
.child-node-item {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
padding: 8px 10px;
|
|
background-color: rgba(255, 255, 255, 0.03);
|
|
border-radius: 4px;
|
|
font-size: 12px;
|
|
transition: background-color 0.15s;
|
|
cursor: default;
|
|
}
|
|
|
|
.child-node-item:hover {
|
|
background-color: rgba(255, 255, 255, 0.05);
|
|
}
|
|
|
|
.child-node-index {
|
|
color: #666;
|
|
min-width: 20px;
|
|
font-size: 12px;
|
|
}
|
|
|
|
.child-node-name {
|
|
color: #ccc;
|
|
flex: 1;
|
|
font-size: 12px;
|
|
}
|
|
|
|
.file-preview-content {
|
|
background: #1e1e1e;
|
|
border: 1px solid #3e3e3e;
|
|
border-radius: 4px;
|
|
padding: 12px;
|
|
max-height: 400px;
|
|
overflow-y: auto;
|
|
font-family: Consolas, Monaco, monospace;
|
|
font-size: 12px;
|
|
line-height: 1.6;
|
|
color: #d4d4d4;
|
|
white-space: pre-wrap;
|
|
word-break: break-word;
|
|
}
|
|
|
|
.file-preview-content::-webkit-scrollbar {
|
|
width: 10px;
|
|
}
|
|
|
|
.file-preview-content::-webkit-scrollbar-track {
|
|
background: #1e1e1e;
|
|
}
|
|
|
|
.file-preview-content::-webkit-scrollbar-thumb {
|
|
background: #424242;
|
|
border-radius: 5px;
|
|
}
|
|
|
|
.file-preview-content::-webkit-scrollbar-thumb:hover {
|
|
background: #4e4e4e;
|
|
}
|
|
|
|
.spin-slow {
|
|
animation: spin 2s linear infinite;
|
|
}
|
|
|
|
@keyframes spin {
|
|
from {
|
|
transform: rotate(0deg);
|
|
}
|
|
to {
|
|
transform: rotate(360deg);
|
|
}
|
|
}
|
|
|
|
/* 添加组件菜单样式 */
|
|
.section-title-with-action {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
}
|
|
|
|
.component-menu-container {
|
|
position: relative;
|
|
}
|
|
|
|
.add-component-trigger {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 2px;
|
|
padding: 2px 5px;
|
|
background: #3b82f6;
|
|
border: none;
|
|
border-radius: 2px;
|
|
color: #fff;
|
|
cursor: pointer;
|
|
font-size: 10px;
|
|
font-weight: 500;
|
|
transition: all 0.1s ease;
|
|
height: 18px;
|
|
}
|
|
|
|
.add-component-trigger:hover {
|
|
background: #2563eb;
|
|
}
|
|
|
|
.add-component-trigger:active {
|
|
background: #1d4ed8;
|
|
}
|
|
|
|
.component-dropdown-overlay {
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
right: 0;
|
|
bottom: 0;
|
|
z-index: var(--z-index-dropdown);
|
|
}
|
|
|
|
.component-dropdown {
|
|
position: fixed;
|
|
min-width: 220px;
|
|
max-height: 320px;
|
|
background: var(--color-bg-elevated);
|
|
border: 1px solid var(--color-border-strong);
|
|
border-radius: 8px;
|
|
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
|
|
z-index: calc(var(--z-index-dropdown) + 1);
|
|
overflow: hidden;
|
|
animation: dropdownSlide 0.15s ease;
|
|
}
|
|
|
|
@keyframes dropdownSlide {
|
|
from {
|
|
opacity: 0;
|
|
transform: translateY(-8px);
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
transform: translateY(0);
|
|
}
|
|
}
|
|
|
|
.component-dropdown-search {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
padding: 8px 12px;
|
|
border-bottom: 1px solid var(--color-border-default);
|
|
background: var(--color-bg-base);
|
|
}
|
|
|
|
.component-dropdown-search svg {
|
|
color: var(--color-text-tertiary);
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.component-dropdown-search input {
|
|
flex: 1;
|
|
background: transparent;
|
|
border: none;
|
|
outline: none;
|
|
color: var(--color-text-primary);
|
|
font-size: 12px;
|
|
}
|
|
|
|
.component-dropdown-search input::placeholder {
|
|
color: var(--color-text-tertiary);
|
|
}
|
|
|
|
.component-dropdown-empty {
|
|
padding: 16px 12px;
|
|
text-align: center;
|
|
color: var(--color-text-tertiary);
|
|
font-size: 12px;
|
|
}
|
|
|
|
.component-dropdown-list {
|
|
max-height: 260px;
|
|
overflow-y: auto;
|
|
padding: 4px 0;
|
|
}
|
|
|
|
.component-dropdown-list::-webkit-scrollbar {
|
|
width: 6px;
|
|
}
|
|
|
|
.component-dropdown-list::-webkit-scrollbar-track {
|
|
background: transparent;
|
|
}
|
|
|
|
.component-dropdown-list::-webkit-scrollbar-thumb {
|
|
background: rgba(255, 255, 255, 0.15);
|
|
border-radius: 3px;
|
|
}
|
|
|
|
.component-dropdown-list::-webkit-scrollbar-thumb:hover {
|
|
background: rgba(255, 255, 255, 0.25);
|
|
}
|
|
|
|
.component-category-group {
|
|
margin-bottom: 4px;
|
|
}
|
|
|
|
.component-category-group:last-child {
|
|
margin-bottom: 0;
|
|
}
|
|
|
|
.component-category-header {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
width: 100%;
|
|
padding: 8px 12px;
|
|
background: var(--color-bg-base);
|
|
border: none;
|
|
color: var(--color-text-secondary);
|
|
font-size: 11px;
|
|
font-weight: 600;
|
|
cursor: pointer;
|
|
text-align: left;
|
|
transition: all var(--transition-fast);
|
|
}
|
|
|
|
.component-category-header:hover {
|
|
background: var(--color-bg-hover);
|
|
color: var(--color-text-primary);
|
|
}
|
|
|
|
.component-category-header svg {
|
|
color: var(--color-text-tertiary);
|
|
}
|
|
|
|
.component-category-count {
|
|
margin-left: auto;
|
|
padding: 1px 6px;
|
|
background: var(--color-bg-inset);
|
|
border-radius: 10px;
|
|
font-size: 10px;
|
|
font-weight: 500;
|
|
color: var(--color-text-tertiary);
|
|
}
|
|
|
|
.component-category-label {
|
|
padding: 6px 12px 4px;
|
|
font-size: 10px;
|
|
font-weight: 600;
|
|
color: var(--color-text-tertiary);
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.05em;
|
|
}
|
|
|
|
.component-dropdown-item {
|
|
display: flex;
|
|
flex-direction: row;
|
|
align-items: center;
|
|
gap: 8px;
|
|
width: 100%;
|
|
padding: 6px 12px 6px 28px;
|
|
background: transparent;
|
|
border: none;
|
|
color: var(--color-text-primary);
|
|
cursor: pointer;
|
|
text-align: left;
|
|
transition: all 0.1s ease;
|
|
}
|
|
|
|
.component-dropdown-item svg {
|
|
color: var(--color-text-tertiary);
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.component-dropdown-item:hover {
|
|
background: var(--color-bg-hover);
|
|
}
|
|
|
|
.component-dropdown-item:active {
|
|
background: var(--color-primary);
|
|
}
|
|
|
|
.component-dropdown-item.selected {
|
|
background: var(--color-bg-active, #3b82f6);
|
|
color: #fff;
|
|
}
|
|
|
|
.component-dropdown-item.selected svg {
|
|
color: rgba(255, 255, 255, 0.8);
|
|
}
|
|
|
|
.component-dropdown-item-name {
|
|
font-size: 12px;
|
|
font-weight: 500;
|
|
}
|
|
|
|
.component-dropdown-item-desc {
|
|
font-size: 10px;
|
|
color: var(--color-text-tertiary);
|
|
margin-top: 2px;
|
|
}
|
|
|
|
/* 组件列表项样式 */
|
|
.component-item-card {
|
|
margin-bottom: 0;
|
|
background: #262626;
|
|
border: none;
|
|
border-bottom: 1px solid #1a1a1a;
|
|
overflow: visible;
|
|
}
|
|
|
|
.component-item-card.expanded {
|
|
background: #262626;
|
|
}
|
|
|
|
.component-item-header {
|
|
display: flex;
|
|
align-items: center;
|
|
padding: 0 8px;
|
|
background: #2d2d2d;
|
|
cursor: pointer;
|
|
user-select: none;
|
|
height: 26px;
|
|
gap: 6px;
|
|
}
|
|
|
|
.component-item-header:hover {
|
|
background: #333;
|
|
}
|
|
|
|
.component-expand-icon {
|
|
display: flex;
|
|
align-items: center;
|
|
color: #888;
|
|
width: 12px;
|
|
height: 12px;
|
|
}
|
|
|
|
.component-item-card.expanded .component-expand-icon {
|
|
color: #ccc;
|
|
}
|
|
|
|
.component-icon {
|
|
display: flex;
|
|
align-items: center;
|
|
color: #888;
|
|
}
|
|
|
|
.component-item-card.expanded .component-icon {
|
|
color: #ccc;
|
|
}
|
|
|
|
.component-item-name {
|
|
flex: 1;
|
|
font-size: 12px;
|
|
font-weight: 500;
|
|
color: #ccc;
|
|
}
|
|
|
|
.component-item-card.expanded .component-item-name {
|
|
color: #fff;
|
|
}
|
|
|
|
.component-item-card .component-remove-btn {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
background: transparent;
|
|
border: none;
|
|
color: #555;
|
|
cursor: pointer;
|
|
padding: 2px;
|
|
opacity: 0;
|
|
}
|
|
|
|
.component-item-header:hover .component-remove-btn {
|
|
opacity: 1;
|
|
}
|
|
|
|
.component-item-card .component-remove-btn:hover {
|
|
color: #ef4444;
|
|
}
|
|
|
|
.component-item-content {
|
|
padding: 0;
|
|
background: #262626;
|
|
overflow: visible;
|
|
min-width: 0;
|
|
}
|
|
|
|
/* Property rows inside component */
|
|
.component-item-content .property-row {
|
|
display: flex;
|
|
align-items: flex-start;
|
|
min-height: 22px;
|
|
padding: 2px 0;
|
|
}
|
|
|
|
/* 简单字段垂直居中 | Simple fields center vertically */
|
|
.component-item-content .property-row.simple-field {
|
|
align-items: center;
|
|
}
|
|
|
|
.component-item-content .property-row:hover {
|
|
background: rgba(255, 255, 255, 0.02);
|
|
}
|
|
|
|
/* 资源字段行需要更多高度 | Asset field rows need more height */
|
|
.component-item-content .property-field-asset {
|
|
min-height: 52px !important;
|
|
align-items: flex-start !important;
|
|
}
|
|
|
|
.component-item-content .property-field-asset > .property-label {
|
|
padding-top: 14px;
|
|
}
|
|
|
|
/* Code Preview */
|
|
.code-preview-section {
|
|
flex: 1;
|
|
display: flex;
|
|
flex-direction: column;
|
|
min-height: 200px;
|
|
}
|
|
|
|
.code-preview-section .code-preview-container {
|
|
flex: 1;
|
|
min-height: 0;
|
|
}
|
|
|
|
.code-preview-container {
|
|
border-radius: 4px;
|
|
overflow: hidden;
|
|
border: 1px solid rgba(255, 255, 255, 0.08);
|
|
height: 100%;
|
|
}
|
|
|
|
.code-preview-loading {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
height: 100%;
|
|
color: #888;
|
|
font-size: 12px;
|
|
}
|
|
|
|
/* ==================== Transform Component ==================== */
|
|
.transform-section {
|
|
background: #262626;
|
|
border-bottom: 1px solid #1a1a1a;
|
|
}
|
|
|
|
.transform-section-header {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 4px;
|
|
padding: 0 6px;
|
|
background: #2d2d2d;
|
|
cursor: pointer;
|
|
user-select: none;
|
|
height: 24px;
|
|
border-bottom: 1px solid #1a1a1a;
|
|
}
|
|
|
|
.transform-section-header:hover {
|
|
background: #333;
|
|
}
|
|
|
|
.transform-section-expand {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
color: #888;
|
|
transition: transform 0.15s ease;
|
|
width: 14px;
|
|
height: 14px;
|
|
}
|
|
|
|
.transform-section-expand.expanded {
|
|
transform: rotate(90deg);
|
|
}
|
|
|
|
.transform-section-title {
|
|
font-size: 11px;
|
|
font-weight: 600;
|
|
color: #ccc;
|
|
flex: 1;
|
|
}
|
|
|
|
.transform-section-content {
|
|
padding: 4px 0;
|
|
}
|
|
|
|
/* Transform Row */
|
|
.transform-row {
|
|
display: flex;
|
|
align-items: center;
|
|
padding: 3px 8px;
|
|
min-height: 22px;
|
|
gap: 4px;
|
|
}
|
|
|
|
.transform-row:hover {
|
|
background: rgba(255, 255, 255, 0.02);
|
|
}
|
|
|
|
/* Transform Row Label */
|
|
.transform-row-label {
|
|
display: flex;
|
|
align-items: center;
|
|
width: 64px;
|
|
min-width: 64px;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.transform-label-text {
|
|
font-size: 11px;
|
|
color: #999;
|
|
font-weight: 400;
|
|
}
|
|
|
|
/* Transform Row Inputs Container */
|
|
.transform-row-inputs {
|
|
display: flex;
|
|
flex: 1;
|
|
gap: 3px;
|
|
min-width: 0;
|
|
}
|
|
|
|
.transform-row-inputs.rotation-single {
|
|
/* Single rotation input takes full width */
|
|
}
|
|
|
|
/* Transform Axis Input */
|
|
.transform-axis-input {
|
|
display: flex;
|
|
align-items: center;
|
|
flex: 1;
|
|
min-width: 0;
|
|
position: relative;
|
|
background: #1e1e1e;
|
|
border: 1px solid #3a3a3a;
|
|
border-radius: 2px;
|
|
height: 18px;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.transform-axis-input:hover {
|
|
border-color: #4a4a4a;
|
|
background: #222;
|
|
}
|
|
|
|
.transform-axis-input:focus-within {
|
|
border-color: #4a9eff;
|
|
}
|
|
|
|
.transform-axis-input.dragging {
|
|
border-color: #4a9eff;
|
|
}
|
|
|
|
/* Color bar indicator inside input */
|
|
.transform-axis-bar {
|
|
width: 3px;
|
|
height: 100%;
|
|
flex-shrink: 0;
|
|
cursor: ew-resize;
|
|
transition: width 0.1s ease;
|
|
}
|
|
|
|
.transform-axis-bar:hover {
|
|
width: 4px;
|
|
}
|
|
|
|
.transform-axis-bar.x {
|
|
background: #c83232;
|
|
}
|
|
|
|
.transform-axis-bar.y {
|
|
background: #32a852;
|
|
}
|
|
|
|
.transform-axis-bar.z {
|
|
background: #3264c8;
|
|
}
|
|
|
|
.transform-axis-input input {
|
|
flex: 1;
|
|
min-width: 0;
|
|
height: 100%;
|
|
padding: 0 4px;
|
|
background: transparent;
|
|
border: none;
|
|
font-size: 10px;
|
|
font-family: 'Consolas', 'Monaco', 'Menlo', monospace;
|
|
color: #ddd;
|
|
text-align: left;
|
|
-moz-appearance: textfield;
|
|
}
|
|
|
|
.transform-axis-input input::-webkit-outer-spin-button,
|
|
.transform-axis-input input::-webkit-inner-spin-button {
|
|
-webkit-appearance: none;
|
|
margin: 0;
|
|
}
|
|
|
|
.transform-axis-input input:focus {
|
|
outline: none;
|
|
background: rgba(74, 158, 255, 0.05);
|
|
}
|
|
|
|
/* Suffix (like degree symbol) */
|
|
.transform-axis-suffix {
|
|
font-size: 9px;
|
|
color: #666;
|
|
padding-right: 4px;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
/* Lock Button */
|
|
.transform-lock-btn {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 18px;
|
|
height: 18px;
|
|
background: transparent;
|
|
border: none;
|
|
color: #555;
|
|
cursor: pointer;
|
|
padding: 0;
|
|
flex-shrink: 0;
|
|
border-radius: 2px;
|
|
}
|
|
|
|
.transform-lock-btn:hover {
|
|
color: #888;
|
|
background: rgba(255, 255, 255, 0.05);
|
|
}
|
|
|
|
.transform-lock-btn.locked {
|
|
color: #f59e0b;
|
|
}
|
|
|
|
/* Reset Button */
|
|
.transform-reset-btn {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 18px;
|
|
height: 18px;
|
|
background: transparent;
|
|
border: none;
|
|
color: #444;
|
|
cursor: pointer;
|
|
padding: 0;
|
|
flex-shrink: 0;
|
|
border-radius: 2px;
|
|
opacity: 0;
|
|
transition: opacity 0.1s ease;
|
|
}
|
|
|
|
.transform-row:hover .transform-reset-btn {
|
|
opacity: 1;
|
|
}
|
|
|
|
.transform-reset-btn:hover {
|
|
color: #888;
|
|
background: rgba(255, 255, 255, 0.05);
|
|
}
|
|
|
|
/* Mobility Row */
|
|
.transform-mobility-row {
|
|
display: flex;
|
|
align-items: center;
|
|
padding: 3px 8px;
|
|
min-height: 22px;
|
|
gap: 4px;
|
|
margin-top: 4px;
|
|
border-top: 1px solid #333;
|
|
}
|
|
|
|
.transform-mobility-label {
|
|
font-size: 11px;
|
|
color: #999;
|
|
width: 64px;
|
|
min-width: 64px;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.transform-mobility-buttons {
|
|
display: flex;
|
|
gap: 0;
|
|
flex: 1;
|
|
}
|
|
|
|
.transform-mobility-btn {
|
|
flex: 1;
|
|
padding: 0 6px;
|
|
font-size: 10px;
|
|
font-weight: 400;
|
|
color: #888;
|
|
background: #2a2a2a;
|
|
border: 1px solid #3a3a3a;
|
|
cursor: pointer;
|
|
height: 18px;
|
|
transition: all 0.1s ease;
|
|
}
|
|
|
|
.transform-mobility-btn:first-child {
|
|
border-radius: 2px 0 0 2px;
|
|
}
|
|
|
|
.transform-mobility-btn:last-child {
|
|
border-radius: 0 2px 2px 0;
|
|
}
|
|
|
|
.transform-mobility-btn:not(:first-child) {
|
|
border-left: none;
|
|
}
|
|
|
|
.transform-mobility-btn:hover {
|
|
background: #3a3a3a;
|
|
color: #ccc;
|
|
}
|
|
|
|
.transform-mobility-btn.active {
|
|
background: #3b82f6;
|
|
border-color: #3b82f6;
|
|
color: #fff;
|
|
}
|
|
|
|
/* ========== Prefab Inspector Styles ========== */
|
|
|
|
.prefab-inspector .inspector-header {
|
|
border-left: 3px solid #4ade80;
|
|
}
|
|
|
|
.prefab-hierarchy {
|
|
background: #1a1a1a;
|
|
border-radius: 4px;
|
|
padding: 4px 0;
|
|
max-height: 200px;
|
|
overflow-y: auto;
|
|
}
|
|
|
|
.prefab-entity-node {
|
|
font-size: 11px;
|
|
}
|
|
|
|
.prefab-entity-row {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 4px;
|
|
padding: 2px 4px;
|
|
cursor: pointer;
|
|
border-radius: 2px;
|
|
}
|
|
|
|
.prefab-entity-row:hover {
|
|
background: #2a2a2a;
|
|
}
|
|
|
|
.prefab-entity-expand {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 12px;
|
|
color: #666;
|
|
}
|
|
|
|
.prefab-entity-icon {
|
|
color: #4ade80;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.prefab-entity-name {
|
|
flex: 1;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
color: #ccc;
|
|
}
|
|
|
|
.prefab-entity-components {
|
|
color: #666;
|
|
font-size: 10px;
|
|
}
|
|
|
|
.prefab-component-types {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: 4px;
|
|
padding: 4px 0;
|
|
}
|
|
|
|
.prefab-component-type-tag {
|
|
display: inline-block;
|
|
padding: 2px 6px;
|
|
background: #2a2a2a;
|
|
border: 1px solid #3a3a3a;
|
|
border-radius: 3px;
|
|
font-size: 10px;
|
|
color: #a78bfa;
|
|
}
|
|
|
|
.prefab-instantiate-btn:hover {
|
|
background: #22c55e !important;
|
|
}
|
|
|
|
/* ========== Prefab Property Override Styles ========== */
|
|
/* 预制体属性覆盖样式 */
|
|
|
|
/* Property row with override indicator | 带覆盖指示的属性行 */
|
|
.property-row.overridden {
|
|
position: relative;
|
|
}
|
|
|
|
.property-row.overridden::before {
|
|
content: '';
|
|
position: absolute;
|
|
left: 0;
|
|
top: 0;
|
|
bottom: 0;
|
|
width: 3px;
|
|
background: #3b82f6;
|
|
border-radius: 2px 0 0 2px;
|
|
}
|
|
|
|
.property-row.overridden .property-label {
|
|
color: #60a5fa;
|
|
font-weight: 600;
|
|
}
|
|
|
|
/* Override indicator dot for compact views | 紧凑视图的覆盖指示点 */
|
|
.property-override-indicator {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 6px;
|
|
height: 6px;
|
|
background: #3b82f6;
|
|
border-radius: 50%;
|
|
margin-left: 4px;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
/* Transform input override state | Transform 输入框覆盖状态 */
|
|
.transform-axis-input.overridden {
|
|
border-color: #3b82f6;
|
|
box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.2);
|
|
}
|
|
|
|
.transform-axis-input.overridden .transform-axis-bar {
|
|
background: #3b82f6;
|
|
}
|
|
|
|
/* Context menu for reverting property | 还原属性的上下文菜单 */
|
|
.property-context-menu {
|
|
position: fixed;
|
|
background: #2d2d2d;
|
|
border: 1px solid #3e3e3e;
|
|
border-radius: 4px;
|
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
|
|
z-index: 9999;
|
|
min-width: 140px;
|
|
padding: 4px 0;
|
|
}
|
|
|
|
.property-context-menu-item {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
width: 100%;
|
|
padding: 6px 12px;
|
|
background: transparent;
|
|
border: none;
|
|
color: #ccc;
|
|
font-size: 11px;
|
|
text-align: left;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.property-context-menu-item:hover {
|
|
background: #3a3a3a;
|
|
}
|
|
|
|
.property-context-menu-item.revert {
|
|
color: #60a5fa;
|
|
}
|
|
|
|
.property-context-menu-item.revert:hover {
|
|
background: rgba(59, 130, 246, 0.2);
|
|
}
|
|
|
|
/* Component header prefab instance indicator | 组件头部预制体实例指示 */
|
|
.component-item-header.prefab-instance {
|
|
border-left: 2px solid #3b82f6;
|
|
}
|
|
|
|
.component-item-header.prefab-instance .component-item-name::after {
|
|
content: '';
|
|
display: inline-block;
|
|
width: 6px;
|
|
height: 6px;
|
|
background: #3b82f6;
|
|
border-radius: 50%;
|
|
margin-left: 6px;
|
|
vertical-align: middle;
|
|
}
|