fix(physics): 启用物理调试绘制并设置英雄碰撞组

启用AABB和质心的物理调试绘制标志,并在HeroViewComp中设置碰撞器组为英雄组
This commit is contained in:
2025-11-03 10:56:32 +08:00
parent 5805e00895
commit e4905bcca2
2 changed files with 7 additions and 3 deletions

View File

@@ -53,7 +53,11 @@ export class HeroViewComp extends CCComp {
this.on(GameEvent.FightEnd,this.do_fight_end,this)
const collider = this.node.getComponent(BoxCollider2D);
this.scheduleOnce(()=>{
if (collider) collider.enabled = true; // 先禁
if (collider) {
collider.enabled = true; // 先禁
collider.group = this.box_group; // 设置为英雄组
}
},0.1)
// let anm = this.node.getChildByName("anm")
// anm.setScale(anm.scale.x*0.8,anm.scale.y*0.8);