* refactor(engine): 重构2D渲染管线坐标系统 * feat(engine): 完善2D渲染管线和编辑器视口功能 * feat(editor): 实现Viewport变换工具系统 * feat(editor): 优化Inspector渲染性能并修复Gizmo变换工具显示 * feat(editor): 实现Run on Device移动预览功能 * feat(editor): 添加组件属性控制和依赖关系系统 * feat(editor): 实现动画预览功能和优化SpriteAnimator编辑器 * feat(editor): 修复SpriteAnimator动画预览功能并迁移CI到pnpm * feat(editor): 修复SpriteAnimator动画预览并迁移到pnpm * feat(editor): 修复SpriteAnimator动画预览并迁移到pnpm * feat(editor): 修复SpriteAnimator动画预览并迁移到pnpm * feat(editor): 修复SpriteAnimator动画预览并迁移到pnpm * feat(ci): 迁移项目到pnpm并修复CI构建问题 * chore: 迁移CI工作流到pnpm并添加WASM构建支持 * chore: 迁移CI工作流到pnpm并添加WASM构建支持 * chore: 迁移CI工作流到pnpm并添加WASM构建支持 * chore: 迁移CI工作流到pnpm并添加WASM构建支持 * chore: 迁移CI工作流到pnpm并添加WASM构建支持 * chore: 迁移CI工作流到pnpm并添加WASM构建支持 * chore: 移除 network 相关包 * chore: 移除 network 相关包
48 lines
981 B
TypeScript
48 lines
981 B
TypeScript
/**
|
|
* 行为树编辑器常量定义
|
|
*/
|
|
|
|
// 根节点 ID
|
|
export const ROOT_NODE_ID = 'root';
|
|
|
|
// 节点类型
|
|
export enum NodeType {
|
|
Root = 'root',
|
|
Sequence = 'sequence',
|
|
Selector = 'selector',
|
|
Parallel = 'parallel',
|
|
Decorator = 'decorator',
|
|
Action = 'action',
|
|
Condition = 'condition'
|
|
}
|
|
|
|
// 端口类型
|
|
export enum PortType {
|
|
Input = 'input',
|
|
Output = 'output'
|
|
}
|
|
|
|
// 编辑器默认配置
|
|
export const DEFAULT_EDITOR_CONFIG = {
|
|
showGrid: true,
|
|
gridSize: 20,
|
|
snapToGrid: true,
|
|
canvasBackground: '#1a1a1a',
|
|
connectionColor: '#4a9eff',
|
|
nodeSpacing: { x: 200, y: 100 },
|
|
nodeWidth: 160,
|
|
nodeHeight: 60,
|
|
portSize: 8
|
|
};
|
|
|
|
// 颜色配置
|
|
export const NODE_COLORS = {
|
|
[NodeType.Root]: '#666',
|
|
[NodeType.Sequence]: '#4a9eff',
|
|
[NodeType.Selector]: '#ffb84d',
|
|
[NodeType.Parallel]: '#b84dff',
|
|
[NodeType.Decorator]: '#4dffb8',
|
|
[NodeType.Action]: '#ff4d4d',
|
|
[NodeType.Condition]: '#4dff9e'
|
|
};
|