This commit is contained in:
2024-09-11 18:00:43 +08:00
parent ef4e502adf
commit 4501876c37
44 changed files with 518 additions and 4634 deletions

View File

@@ -5,7 +5,7 @@
* @LastEditTime: 2022-08-17 12:36:18
*/
import { _decorator,Sprite,Color} from "cc";
import { _decorator,Sprite,Color, Prefab, instantiate} from "cc";
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
import { HeroSpine } from "./HeroSpine";
@@ -33,6 +33,7 @@ export class HeroBuffComp extends CCComp {
timer:Timer = new Timer(0.1);
buffs:any=[];
group:number=BoxSet.HERO;
/**
skill_uuid:number=0;
atk:number=0;
@@ -77,7 +78,12 @@ export class HeroBuffComp extends CCComp {
this.node.destroy();
}
show_buff_atk(){
var path = "game/skills/buff/atk"
var prefab: Prefab = oops.res.get(path, Prefab)!;
var node = instantiate(prefab);
node.setPosition(this.node.position.x,this.node.position.y+40,this.node.position.z);
}
buff_add(buff:any){
if(!this.node.isValid){ return }
let i = 0
@@ -106,6 +112,7 @@ export class HeroBuffComp extends CCComp {
this.buffs.push(buff);
if(buff.atk>0){
this.mv.atk+=(buff.atk+buff.args.atk);
this.show_buff_atk();
}
if(buff.hp>0){
this.mv.hp+=(buff.hp+buff.args.hp);