|
@@ -358,7 +358,7 @@ export class Enemy extends BaseExp {
|
|
//动画和回收时间
|
|
//动画和回收时间
|
|
let recycleTime: number = 2;
|
|
let recycleTime: number = 2;
|
|
if(!this.isTank()){
|
|
if(!this.isTank()){
|
|
- this.skeletalAnim.play(EAnimType.die);
|
|
|
|
|
|
+ ResUtil.playSkeletalAnim(this.skeletalAnim,EAnimType.die);
|
|
}else{
|
|
}else{
|
|
//坦克爆炸后生成爆炸特效
|
|
//坦克爆炸后生成爆炸特效
|
|
ResUtil.playParticle(
|
|
ResUtil.playParticle(
|
|
@@ -401,16 +401,17 @@ export class Enemy extends BaseExp {
|
|
public showHurt(hpStr: string) {
|
|
public showHurt(hpStr: string) {
|
|
if(Game.I.isGameOver || this.isDead) return;
|
|
if(Game.I.isGameOver || this.isDead) return;
|
|
//敌人流血特效
|
|
//敌人流血特效
|
|
- /*ResUtil.playParticle(
|
|
|
|
|
|
+ ResUtil.playParticle(
|
|
`effects/Prefabs/blood`,
|
|
`effects/Prefabs/blood`,
|
|
1,
|
|
1,
|
|
|
|
+ new Vec3(0.2,0.2,0.2),
|
|
(blood) => {
|
|
(blood) => {
|
|
blood.active = true;
|
|
blood.active = true;
|
|
- blood.parent = this.hurt_num.parent;
|
|
|
|
- const targetPos: Vec3 = this.hurt_num.parent.worldPosition.clone();
|
|
|
|
- blood.worldPosition = targetPos;
|
|
|
|
|
|
+ blood.parent = this.enemyNode.parent;
|
|
|
|
+ const targetPos: Vec3 = this.enemyNode.worldPosition.clone();
|
|
|
|
+ blood.worldPosition = new Vec3(targetPos.x,targetPos.y - 0.2,targetPos.z);
|
|
}
|
|
}
|
|
- );*/
|
|
|
|
|
|
+ );
|
|
//创建3D伤害数字
|
|
//创建3D伤害数字
|
|
const n = PoolManager.getNode(this.hurt_num, this.hurt_num.parent);
|
|
const n = PoolManager.getNode(this.hurt_num, this.hurt_num.parent);
|
|
let label:Label = n.getComponent(Label);
|
|
let label:Label = n.getComponent(Label);
|
|
@@ -580,8 +581,7 @@ export class Enemy extends BaseExp {
|
|
this.tank_walk.active = false;
|
|
this.tank_walk.active = false;
|
|
this.tank_shoot.active = true;
|
|
this.tank_shoot.active = true;
|
|
} else {
|
|
} else {
|
|
- const time: number = 1 / this.data.atk_speed;
|
|
|
|
- ResUtil.playSkeletalAnim(this.skeletalAnim, EAnimType.shoot, time);
|
|
|
|
|
|
+ ResUtil.playSkeletalAnim(this.skeletalAnim, EAnimType.shoot, this.data.atk_speed);
|
|
}
|
|
}
|
|
this.updateDir(Game.I.player.node.worldPosition);
|
|
this.updateDir(Game.I.player.node.worldPosition);
|
|
}
|
|
}
|