feat: 完成英雄配置编辑器全流程功能开发

本次提交实现了完整的英雄配置管理系统:
1.  新增服务器端英雄数据持久化接口,支持读取和保存英雄配置
2.  重构前端英雄编辑器UI,替换侧边栏为下拉选择器适配移动端
3.  统一调整前端页面样式,压缩间距适配更多内容
4.  修复Tooltip组件显示逻辑,优化技能飘字效果
5.  导入CSV英雄配置数据,补全全职业技能配置
6.  调整多个英雄预制体的尺寸和位置参数
7.  生成完整的英雄配置导出文件hexport.ts
This commit is contained in:
pan
2026-09-03 16:47:49 +08:00
parent 6a09ae2954
commit 87f771edd1
16 changed files with 1248 additions and 330 deletions

View File

@@ -1,4 +1,4 @@
import { _decorator, Collider2D, Contact2DType, v3, IPhysics2DContact, Vec3, tween, Label, resources, SpriteFrame, Sprite, UIOpacity, Color, math, Tween,Node } from "cc";
import { _decorator, Collider2D, Contact2DType, v3, IPhysics2DContact, Vec3, tween, Label, resources, SpriteFrame, Sprite, UIOpacity, Color, math, Tween, Node } from "cc";
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
import { SkillSet } from "../common/config/SkillSet";
@@ -22,7 +22,7 @@ export class TooltipCom extends CCComp {
dead_bg: Node = null;
@property(Node)
revive_bg: Node = null;
stype: number = 1; // 1:减少生命值,2:增加生命值,3:技能图标
value: string = "";
s_uuid: number = 1001;
@@ -31,7 +31,7 @@ export class TooltipCom extends CCComp {
triggerType: string = "";
/** DoT 飘字需激活的 debuff 图标节点名(loss_life/hp/debuff 下的子节点,如 FireDamage);空串=普通伤害 */
debuffIcon: string = "";
// 动画参数配置
private readonly popDuration = 0.15;
private readonly driftDuration = 0.5;
@@ -59,13 +59,13 @@ export class TooltipCom extends CCComp {
this._uiOpacity = this.node.addComponent(UIOpacity);
}
this._uiOpacity.opacity = 255;
// 检测父节点翻转
let sx = 1;
if (this.node.parent && this.node.parent.scale.x < 0) {
sx = -1;
}
// 🔥 关键修复:停止当前节点和 UIOpacity 上的所有缓动
Tween.stopAllByTarget(this.node);
if (this._uiOpacity) {
@@ -82,12 +82,12 @@ export class TooltipCom extends CCComp {
let scaleMax = 1.5;
let isCrit = false;
let isHeal = false;
// 初始随机偏移,防止完全重叠
const offsetX = (Math.random() - 0.5) * 40;
// 设置极高的渲染层级,防止被怪物遮挡
const topSiblingIndex = 9999;
const topSiblingIndex = 9999;
// 临时变量,存储当前Y坐标,方便统一处理。增加60的Y轴基础偏移,防止伤害飘字等遮挡血条
let currentY = this.node.position.y + 60;
@@ -122,8 +122,9 @@ export class TooltipCom extends CCComp {
case TooltipTypes.skill:
const skillConfig = SkillSet[this.s_uuid];
const skillName = skillConfig ? skillConfig.name : "";
this.setupLabel("skill", "name", skillName+this.value);
// this.node.setPosition(v3(this.node.position.x, currentY));
this.setupLabel("skill", "name", skillName + this.value);
// 技能喊话基于 load 传入位置再抬高 50,避免遮挡角色
this.node.setPosition(v3(this.node.position.x, this.node.position.y + 50));
this.node.setSiblingIndex(topSiblingIndex);
// 根据触发类型激活对应的背景标识(追击/反击/起手/生息/亡语/复活)
this.setupTriggerBg(this.triggerType);
@@ -151,7 +152,7 @@ export class TooltipCom extends CCComp {
case TooltipTypes.shield: // 护盾减免
this.node.setPosition(v3(this.node.position.x + offsetX, currentY));
this.node.setSiblingIndex(topSiblingIndex);
this.setupLabel("add_life", "hp", "减免");
this.setupLabel("add_life", "hp", "0");
isHeal = true;
break;
}
@@ -210,7 +211,7 @@ export class TooltipCom extends CCComp {
playAnimation(scaleMax: number, isCrit: boolean, isHeal: boolean, sx: number = 1) {
// 随机 X 轴偏移 (防止重叠)
const randomX = (Math.random() - 0.5) * 60;
const randomX = (Math.random() - 0.5) * 60;
const moveY = 80;
const t = tween(this.node);