dd
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user