This commit is contained in:
2024-09-09 07:56:18 +08:00
parent 47af795c12
commit 9bac2d5c5b
264 changed files with 96262 additions and 53551 deletions

View File

@@ -12,7 +12,7 @@ const { ccclass, property } = _decorator;
@ccclass('RoleBuffComp')
@ecs.register('RoleBuff', false)
export class RoleBuffComp extends CCComp {
as: RoleSpine = null!;
// as: RoleSpine = null!;
mv!: RoleViewComp
timer:Timer = new Timer(0.1);
@@ -28,7 +28,7 @@ export class RoleBuffComp extends CCComp {
onLoad() {
this.as = this.node.getComponent(RoleSpine);
// this.as = this.node.getComponent(RoleSpine);
this.mv= this.getComponent(RoleViewComp);
} /** 视图层逻辑代码分离演示 */
start () {
@@ -73,7 +73,7 @@ export class RoleBuffComp extends CCComp {
b.time=buff.time;
if(buff.atk>0){
this.node.getChildByName("avatar").setScale(1.2,1.2)
// this.node.getChildByName("avatar").getChildByName("TNode").getChildByName("bb").getComponent(Sprite).color= new Color().fromHEX("#F16F6F");
this.node.getChildByName("avatar").getChildByName("TNode").getChildByName("bb").getComponent(Sprite).color= new Color().fromHEX("#F16F6F");
this.mv.atk+=(buff.atk+buff.args.atk-b.atk);
}
if(buff.hp>0){
@@ -95,7 +95,7 @@ export class RoleBuffComp extends CCComp {
if(buff.atk>0){
this.mv.atk+=(buff.atk+buff.args.atk);
this.node.getChildByName("avatar").setScale(1.2,1.2)
// this.node.getChildByName("avatar").getChildByName("TNode").getChildByName("bb").getComponent(Sprite).color= new Color().fromHEX("#F16F6F");
this.node.getChildByName("avatar").getChildByName("TNode").getChildByName("bb").getComponent(Sprite).color= new Color().fromHEX("#F16F6F");
}
if(buff.hp>0){
this.mv.hp+=(buff.hp+buff.args.hp);