feat: 添加跨平台运行时、资产系统和UI适配功能 (#256)

* feat(platform-common): 添加WASM加载器和环境检测API

* feat(rapier2d): 新增Rapier2D WASM绑定包

* feat(physics-rapier2d): 添加跨平台WASM加载器

* feat(asset-system): 添加运行时资产目录和bundle格式

* feat(asset-system-editor): 新增编辑器资产管理包

* feat(editor-core): 添加构建系统和模块管理

* feat(editor-app): 重构浏览器预览使用import maps

* feat(platform-web): 添加BrowserRuntime和资产读取

* feat(engine): 添加材质系统和着色器管理

* feat(material): 新增材质系统和着色器编辑器

* feat(tilemap): 增强tilemap编辑器和动画系统

* feat(modules): 添加module.json配置

* feat(core): 添加module.json和类型定义更新

* chore: 更新依赖和构建配置

* refactor(plugins): 更新插件模板使用ModuleManifest

* chore: 添加第三方依赖库

* chore: 移除BehaviourTree-ai和ecs-astar子模块

* docs: 更新README和文档主题样式

* fix: 修复Rust文档测试和添加rapier2d WASM绑定

* fix(tilemap-editor): 修复画布高DPI屏幕分辨率适配问题

* feat(ui): 添加UI屏幕适配系统(CanvasScaler/SafeArea)

* fix(ecs-engine-bindgen): 添加缺失的ecs-framework-math依赖

* fix: 添加缺失的包依赖修复CI构建

* fix: 修复CodeQL检测到的代码问题

* fix: 修复构建错误和缺失依赖

* fix: 修复类型检查错误

* fix(material-system): 修复tsconfig配置支持TypeScript项目引用

* fix(editor-core): 修复Rollup构建配置添加tauri external

* fix: 修复CodeQL检测到的代码问题

* fix: 修复CodeQL检测到的代码问题
This commit is contained in:
YHH
2025-12-03 22:15:22 +08:00
committed by GitHub
parent caf7622aa0
commit 63f006ab62
496 changed files with 77601 additions and 4067 deletions

View File

@@ -0,0 +1,339 @@
/**
* Tile Animation Editor Styles
* 瓦片动画编辑器样式
*/
.tile-animation-editor-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.7);
display: flex;
align-items: center;
justify-content: center;
z-index: 1000;
}
.tile-animation-editor {
background: #252526;
border: 1px solid #3c3c3c;
border-radius: 8px;
width: 600px;
max-height: 80vh;
display: flex;
flex-direction: column;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
.animation-editor-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 12px 16px;
border-bottom: 1px solid #3c3c3c;
background: #2d2d2d;
border-radius: 8px 8px 0 0;
}
.animation-editor-header h3 {
margin: 0;
font-size: 14px;
font-weight: 500;
color: #e0e0e0;
}
.animation-editor-header .close-btn {
background: none;
border: none;
color: #808080;
cursor: pointer;
padding: 4px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 4px;
}
.animation-editor-header .close-btn:hover {
background: #3c3c3c;
color: #e0e0e0;
}
.animation-editor-content {
display: flex;
padding: 16px;
gap: 16px;
flex: 1;
overflow: hidden;
}
/* Preview Section */
.animation-preview-section {
display: flex;
flex-direction: column;
align-items: center;
gap: 12px;
}
.preview-box {
background: #1a1a1a;
border: 1px solid #3c3c3c;
border-radius: 4px;
padding: 4px;
}
.animation-preview-canvas {
display: block;
image-rendering: pixelated;
}
.preview-controls {
display: flex;
align-items: center;
gap: 8px;
}
.preview-btn {
background: #3c3c3c;
border: none;
color: #e0e0e0;
cursor: pointer;
padding: 6px 10px;
border-radius: 4px;
display: flex;
align-items: center;
justify-content: center;
}
.preview-btn:hover {
background: #4c4c4c;
}
.preview-btn.active {
background: #0e639c;
}
.frame-indicator {
font-size: 12px;
color: #808080;
}
/* Frames Section */
.animation-frames-section {
flex: 1;
display: flex;
flex-direction: column;
min-width: 0;
}
.frames-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 8px;
font-size: 12px;
color: #e0e0e0;
}
.frame-count {
color: #808080;
}
.frames-list {
flex: 1;
overflow-y: auto;
background: #1a1a1a;
border: 1px solid #3c3c3c;
border-radius: 4px;
padding: 8px;
min-height: 150px;
max-height: 200px;
}
.frames-empty {
text-align: center;
color: #808080;
font-size: 12px;
padding: 40px 20px;
}
.frame-item {
display: flex;
align-items: center;
gap: 8px;
padding: 6px 8px;
background: #252526;
border: 1px solid #3c3c3c;
border-radius: 4px;
margin-bottom: 4px;
cursor: grab;
}
.frame-item:active {
cursor: grabbing;
}
.frame-item.drag-over {
border-color: #0e639c;
background: #1e3a5f;
}
.frame-drag-handle {
color: #606060;
cursor: grab;
}
.frame-preview {
flex-shrink: 0;
}
.frame-preview canvas {
display: block;
image-rendering: pixelated;
border: 1px solid #3c3c3c;
border-radius: 2px;
}
.frame-info {
flex: 1;
display: flex;
align-items: center;
gap: 8px;
font-size: 12px;
}
.frame-tile-id {
color: #808080;
min-width: 32px;
}
.frame-duration-input {
width: 60px;
background: #1a1a1a;
border: 1px solid #3c3c3c;
color: #e0e0e0;
padding: 4px 6px;
border-radius: 3px;
font-size: 12px;
}
.frame-duration-input:focus {
outline: none;
border-color: #0e639c;
}
.duration-unit {
color: #808080;
}
.frame-delete-btn {
background: none;
border: none;
color: #808080;
cursor: pointer;
padding: 4px;
border-radius: 4px;
display: flex;
align-items: center;
}
.frame-delete-btn:hover {
background: #5a1d1d;
color: #ff6b6b;
}
/* Tileset Section */
.animation-tileset-section {
border-top: 1px solid #3c3c3c;
padding: 12px 16px;
}
.tileset-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 8px;
font-size: 12px;
color: #e0e0e0;
}
.default-duration {
display: flex;
align-items: center;
gap: 6px;
color: #808080;
}
.default-duration input {
width: 60px;
background: #1a1a1a;
border: 1px solid #3c3c3c;
color: #e0e0e0;
padding: 4px 6px;
border-radius: 3px;
font-size: 12px;
}
.default-duration input:focus {
outline: none;
border-color: #0e639c;
}
.tileset-scroll-container {
max-height: 150px;
overflow: auto;
background: #1a1a1a;
border: 1px solid #3c3c3c;
border-radius: 4px;
}
.animation-tileset-canvas {
display: block;
image-rendering: pixelated;
cursor: pointer;
}
/* Footer */
.animation-editor-footer {
display: flex;
justify-content: space-between;
align-items: center;
padding: 12px 16px;
border-top: 1px solid #3c3c3c;
background: #2d2d2d;
border-radius: 0 0 8px 8px;
}
.footer-right {
display: flex;
gap: 8px;
}
.btn-primary,
.btn-secondary {
padding: 6px 16px;
border-radius: 4px;
font-size: 13px;
cursor: pointer;
border: none;
}
.btn-primary {
background: #0e639c;
color: #fff;
}
.btn-primary:hover {
background: #1177bb;
}
.btn-secondary {
background: #3c3c3c;
color: #e0e0e0;
}
.btn-secondary:hover {
background: #4c4c4c;
}

View File

@@ -9,6 +9,62 @@
user-select: none;
}
/* ==================== Mode Toggle ==================== */
.tileset-mode-toggle {
display: flex;
padding: 6px 8px;
gap: 2px;
background: #1e1e1e;
border-bottom: 1px solid #1a1a1a;
}
.mode-toggle-btn {
display: flex;
align-items: center;
justify-content: center;
gap: 6px;
flex: 1;
height: 28px;
padding: 0 12px;
background: #2d2d30;
border: 1px solid #3c3c3c;
border-radius: 3px;
color: #888;
font-size: 11px;
font-weight: 500;
cursor: pointer;
transition: all 0.15s ease;
}
.mode-toggle-btn:first-child {
border-radius: 3px 0 0 3px;
border-right: none;
}
.mode-toggle-btn:last-child {
border-radius: 0 3px 3px 0;
}
.mode-toggle-btn:hover {
background: #3c3c3c;
color: #e0e0e0;
}
.mode-toggle-btn.active {
background: #094771;
border-color: #0078d4;
color: #fff;
}
.mode-toggle-btn.active:hover {
background: #0a5a8a;
}
.mode-toggle-btn svg {
width: 14px;
height: 14px;
}
/* ==================== Tool Buttons Row ==================== */
.tileset-tools {
display: flex;
@@ -242,6 +298,36 @@
height: 100%;
}
/* ==================== Collision Mode Hint ==================== */
.collision-mode-hint {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 8px;
padding: 24px;
text-align: center;
color: #888;
}
.collision-mode-hint svg {
color: #0078d4;
opacity: 0.8;
}
.collision-mode-title {
font-size: 13px;
font-weight: 600;
color: #e0e0e0;
margin-top: 8px;
}
.collision-mode-desc {
font-size: 11px;
color: #888;
line-height: 1.4;
}
.tileset-select-btn {
padding: 8px 16px;
background: transparent;

View File

@@ -349,6 +349,136 @@
width: 10px;
height: 10px;
color: #888;
flex-shrink: 0;
}
/* ==================== Material Field - AssetField Style ==================== */
.material-section-content {
padding: 8px 10px 8px 20px;
}
.material-field {
display: flex;
flex-direction: column;
gap: 4px;
min-width: 0;
}
.material-field__label {
font-size: 11px;
color: #888;
}
.material-field__content {
display: flex;
align-items: flex-start;
gap: 6px;
min-width: 0;
}
/* Thumbnail Preview */
.material-field__thumbnail {
width: 44px;
height: 44px;
background: #1a1a1a;
border: 1px solid #3a3a3a;
border-radius: 2px;
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
transition: border-color 0.15s ease;
}
.material-field__thumbnail:hover {
border-color: #4a4a4a;
}
.material-field__thumbnail-icon {
color: #555;
}
/* Right side container */
.material-field__right {
flex: 1;
display: flex;
flex-direction: column;
gap: 4px;
min-width: 0;
}
/* Dropdown selector */
.material-field__dropdown {
display: flex;
align-items: center;
height: 22px;
padding: 0 8px;
background: #1a1a1a;
border: 1px solid #3a3a3a;
border-radius: 2px;
cursor: pointer;
transition: border-color 0.15s ease;
min-width: 0;
}
.material-field__dropdown:hover {
border-color: #4a4a4a;
}
.material-field__value {
flex: 1;
font-size: 11px;
color: #888;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-style: italic;
}
.material-field__dropdown.has-value .material-field__value {
color: #ddd;
font-style: normal;
}
.material-field__dropdown-arrow {
color: #666;
flex-shrink: 0;
margin-left: 4px;
}
/* Action buttons row */
.material-field__actions {
display: flex;
align-items: center;
gap: 2px;
}
.material-field__btn {
width: 20px;
height: 20px;
padding: 0;
display: flex;
align-items: center;
justify-content: center;
background: #2a2a2a;
border: 1px solid #3a3a3a;
border-radius: 2px;
color: #888;
cursor: pointer;
transition: all 0.15s ease;
}
.material-field__btn:hover {
background: #3a3a3a;
border-color: #4a4a4a;
color: #ccc;
}
.material-field__btn--clear:hover {
background: #4a2020;
border-color: #5a3030;
color: #f87171;
}
/* ==================== Layer List ==================== */
@@ -485,6 +615,29 @@
color: #c0c0c0;
}
.selected-layer-name.editable {
cursor: text;
padding: 2px 4px;
border-radius: 2px;
transition: background 0.15s ease;
}
.selected-layer-name.editable:hover {
background: rgba(255, 255, 255, 0.1);
}
.layer-name-input {
width: 100%;
height: 22px;
padding: 0 6px;
background: #1e1e1e;
border: 1px solid #0078d4;
border-radius: 2px;
color: #c0c0c0;
font-size: 11px;
outline: none;
}
/* ==================== Select Dropdown ==================== */
.property-row select {
appearance: none;
@@ -495,6 +648,57 @@
cursor: pointer;
}
/* ==================== Slider Property ==================== */
.slider-wrapper {
display: flex;
align-items: center;
gap: 8px;
flex: 1;
}
.property-slider {
flex: 1;
height: 4px;
-webkit-appearance: none;
appearance: none;
background: #3c3c3c;
border-radius: 2px;
outline: none;
cursor: pointer;
}
.property-slider::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 12px;
height: 12px;
background: #0078d4;
border-radius: 50%;
cursor: pointer;
transition: background 0.15s ease;
}
.property-slider::-webkit-slider-thumb:hover {
background: #1a8cff;
}
.property-slider::-moz-range-thumb {
width: 12px;
height: 12px;
background: #0078d4;
border-radius: 50%;
border: none;
cursor: pointer;
}
.slider-value {
font-size: 10px;
color: #888;
min-width: 32px;
text-align: right;
font-family: 'Consolas', 'Monaco', monospace;
}
/* ==================== Scrollbar ==================== */
.details-content::-webkit-scrollbar,
.layer-list-container::-webkit-scrollbar {