下一步 英雄技能 ui 制作

This commit is contained in:
2024-09-19 17:20:13 +08:00
parent 3c9fab6889
commit efaf6ac27c
3 changed files with 673 additions and 827 deletions

View File

@@ -58,13 +58,7 @@ export class RoleViewComp extends CCComp {
power_max: number = 1200; /** 能量最大值 */
power_speed: number = 1; //能量回复速度每0.1秒回复量
skill:8001;
skills:{
1:{uuid:8001,cd:2,alive:true },
2:{uuid:8001,cd:2,alive:false},
3:{uuid:8001,cd:2,alive:false},
4:{uuid:8001,cd:2,alive:false},
5:{uuid:8001,cd:2,alive:false},
}
skills:any=[]
buff_atks:any = [];
buff_atk:number = 0;
@@ -173,9 +167,23 @@ export class RoleViewComp extends CCComp {
this.in_stop(dt);
this.atk_time += dt;
this.in_atk();
this.skill_cds(dt);
// this.move();
this.check_enemys()
}
skill_cds(dt:number){
this.skills.forEach((e:any) => {
if(e.cd > 0&&e.alive){
e.cd -= dt;
if(e.cd <= 0){
this.shoot(e.uuid);
e.cd=smc.skills[e.uuid].cd
console.log("shoot uuid :"+e.uuid);
}
}
});
// console.log(this.skills);
}
check_enemys(){
let enemys=ecs.query(ecs.allOf(MonViewComp));
if(enemys.length > 0){