fix: 修复技能碰撞检测和英雄prefab配置问题

修复技能碰撞检测逻辑,确保正确应用伤害并过滤同组碰撞
调整多个英雄prefab的_enabled状态和碰撞组配置
优化技能视图的日志输出和伤害应用逻辑
移除不必要的prefab组件和调试日志
This commit is contained in:
2025-11-01 23:10:38 +08:00
parent 2e1c6c3aa1
commit 1091b0399e
19 changed files with 40 additions and 164 deletions

View File

@@ -51,7 +51,7 @@ export class HeroViewComp extends CCComp {
const collider = this.node.getComponent(BoxCollider2D);
this.scheduleOnce(()=>{
if (collider) collider.enabled = true; // 先禁
},1)
},0.1)
// let anm = this.node.getChildByName("anm")
// anm.setScale(anm.scale.x*0.8,anm.scale.y*0.8);
}

View File

@@ -37,7 +37,6 @@ export class Monster extends ecs.Entity {
/** 加载角色 */
load(pos: Vec3 = Vec3.ZERO,scale:number = 1,uuid:number=1001,lv:number=1,monType:MonType=MonType.NORMAL, buffs: BuffConf[] = [],is_call=false) {
scale=-1
let box_group=BoxSet.MONSTER
var scene = smc.map.MapView.scene;
var path = "game/heros/"+HeroInfo[uuid].path;
var prefab: Prefab = oops.res.get(path, Prefab)!;
@@ -55,7 +54,7 @@ export class Monster extends ecs.Entity {
let hero = HeroInfo[uuid]; // 共用英雄数据
// 设置 View 层属性(表现相关)
view.scale = scale;
view.box_group = box_group;
view.box_group = BoxSet.MONSTER;
// 设置 Model 层属性(数据相关)
model.hero_uuid = uuid;

View File

@@ -166,6 +166,8 @@ export class SACastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdat
// 这里可以调用 SkillConComp 的目标选择逻辑
// 暂时返回默认位置
if (caster==null ) return
if(caster.ent == null) return
const heroAttrs = caster.ent.get(HeroAttrsComp);
const fac = heroAttrs?.fac ?? 0;
const defaultX = fac === 0 ? 400 : -400;