修改了很多

This commit is contained in:
2025-03-27 23:25:10 +08:00
parent 3a15541170
commit 67704725b2
40 changed files with 9140 additions and 4253 deletions

View File

@@ -89,6 +89,8 @@ export class HeroViewComp extends CCComp {
onLoad() {
this.as = this.getComponent(HeroSpine);
let anm = this.node.getChildByName("anm")
anm.setScale(anm.scale.x*0.7,anm.scale.y*0.7);
// 注册单个碰撞体的回调函数
// let collider = this.getComponent(Collider2D);
@@ -157,12 +159,8 @@ export class HeroViewComp extends CCComp {
let hp_progress= this.hp/this.hp_max;
this.node.getChildByName("top").getChildByName("hp").getComponent(ProgressBar)!.progress = hp_progress;
if(this.is_boss) return
this.node.getChildByName("top").getChildByName("hp").active = true;
// if(this.hp == this.hp_max){
// this.node.getChildByName("top").getChildByName("hp").active = false;
// } else{
// this.node.getChildByName("top").getChildByName("hp").active = true;
// }
this.node.getChildByName("top").getChildByName("hp").active = (this.hp == this.hp_max) ? false : true;
}
//移动
@@ -265,7 +263,7 @@ export class HeroViewComp extends CCComp {
return this.node.position.y <= -900;
}
to_alive(){
let pos =v3(HeroSet.StartPos[this.type],this.node.position.y,this.node.position.z)
let pos =v3(HeroSet.Start_x[this.type],HeroSet.Start_y[this.type],this.node.position.z)
this.node.setPosition(pos)
this.revive()
}