解决一些小问题

This commit is contained in:
2025-11-01 15:02:31 +08:00
parent d014e63d27
commit cb844cf65f
32 changed files with 368 additions and 505 deletions

View File

@@ -15,7 +15,7 @@ import { DamageQueueHelper } from "../hero/DamageQueueComp";
const { ccclass, property } = _decorator;
/** 视图层对象 */
@ccclass('SkillViewComp')
@ccclass('SkillView')
@ecs.register('SkillView', false)
export class SkillView extends CCComp {
/** 视图层逻辑代码分离演示 */
@@ -38,6 +38,7 @@ export class SkillView extends CCComp {
if(collider) {
collider.group = this.group;
collider.on(Contact2DType.BEGIN_CONTACT, this.onBeginContact, this);
console.log(`[skillView] ${this.sData.caster.ent.get(HeroAttrsComp).hero_name}${this.SConf.name} 碰撞组 ${this.group}`)
}
if(this.node.getComponent(Animation)){
let anim = this.node.getComponent(Animation);
@@ -47,7 +48,7 @@ export class SkillView extends CCComp {
}
onBeginContact (seCol: Collider2D, oCol: Collider2D) {
// console.log(this.scale+"碰撞开始 ",seCol,oCol);
console.log(`[skillView] ${this.sData.caster.ent.get(HeroAttrsComp).hero_name}${this.SConf.name} 碰撞了 ${oCol.getComponent(HeroViewComp).ent.get(HeroAttrsComp).hero_name}`);
if(this.SConf.EType!=EType.collision) return
let target = oCol.getComponent(HeroViewComp)
let model=target.ent.get(HeroAttrsComp)