技能layer改变,位置信息修改

This commit is contained in:
2025-01-07 07:54:29 +08:00
parent a9a7f076f4
commit ca5adce589
16 changed files with 75 additions and 536 deletions

View File

@@ -312,13 +312,12 @@ export class HeroViewComp extends CCComp {
}
skill_pos(){
return v3(0,35)
return v3((this.node.position.x,this.node.position.y + 35))
}
get_enemy_pos(){
let t_pos:Vec3 = v3(720,0)
if(this.enemy){
t_pos = v3(this.enemy.x-this.node.position.x,this.enemy.y-this.node.position.y)
t_pos = v3(this.enemy.x,this.enemy.y)
}
console.log(this.hero_name+":"+this.uuid+"enemy ="+this.enemy.x+" x"+this.node.position.x+" t_pos"+t_pos);
return t_pos
@@ -328,7 +327,7 @@ export class HeroViewComp extends CCComp {
if(!hero.node.isValid){
return
}else{
t_pos = v3(hero.node.position.x-this.node.position.x,hero.node.position.y-this.node.position.y)
t_pos = v3(hero.node.position.x,hero.node.position.y)
}
return t_pos
@@ -555,8 +554,8 @@ export class HeroViewComp extends CCComp {
let skill = ecs.getEntity<Skill>(Skill);
let t_pos=this.get_enemy_pos()
let pos =this.skill_pos()
pos.y=pos.y + y
pos.x=pos.x + x
pos.y=this.node.position.y + y
pos.x=this.node.position.x + x
let is_crit=this.check_crit()
skill.load(pos,this.box_group,this.node,sk,this.ap_max,t_pos,is_crit,this.crit_add);
console.log(this.scale+this.hero_name+"使用技能:"+sk+" t_pos:"+t_pos+" box:"+this.box_group,);