This commit is contained in:
2025-05-06 00:06:20 +08:00
parent 64163a675f
commit 14da4fb2d1
2 changed files with 16 additions and 2 deletions

View File

@@ -5170,7 +5170,7 @@
"b": 255,
"a": 255
},
"_string": "使用",
"_string": "召唤",
"_horizontalAlign": 1,
"_verticalAlign": 1,
"_actualFontSize": 25,

View File

@@ -5,6 +5,8 @@ import { GameEvent } from "../common/config/GameEvent";
import { HeroInfo, HeroList } from "../common/config/heroSet";
import { RandomManager } from "db://oops-framework/core/common/random/RandomManager";
import { oops } from "db://oops-framework/core/Oops";
import { HeroModelComp } from "../hero/HeroModelComp";
import { HeroViewComp } from "../hero/HeroViewComp";
const { ccclass, property } = _decorator;
@@ -55,7 +57,19 @@ export class CardComp extends CCComp {
const sprite = show.getChildByName("mask").getChildByName("icon").getComponent(Sprite);
sprite.spriteFrame = atlas.getSpriteFrame(HeroInfo[uuid].path);
});
this.node.getChildByName("Button").getChildByName("Label").getComponent(Label).string=this.check_heros()
}
check_heros(){
let heros=ecs.query(ecs.allOf(HeroModelComp))
for(let hero of heros){
if(hero.get(HeroViewComp).hero_uuid == this.c_uuid){
return "升级"
}
if(hero.get(HeroViewComp).type==HeroInfo[this.c_uuid].type){
return "替换"
}
}
return "召唤"
}
use_card(){
if(this.is_used) return