dd
This commit is contained in:
@@ -5170,7 +5170,7 @@
|
|||||||
"b": 255,
|
"b": 255,
|
||||||
"a": 255
|
"a": 255
|
||||||
},
|
},
|
||||||
"_string": "使用",
|
"_string": "召唤",
|
||||||
"_horizontalAlign": 1,
|
"_horizontalAlign": 1,
|
||||||
"_verticalAlign": 1,
|
"_verticalAlign": 1,
|
||||||
"_actualFontSize": 25,
|
"_actualFontSize": 25,
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ import { GameEvent } from "../common/config/GameEvent";
|
|||||||
import { HeroInfo, HeroList } from "../common/config/heroSet";
|
import { HeroInfo, HeroList } from "../common/config/heroSet";
|
||||||
import { RandomManager } from "db://oops-framework/core/common/random/RandomManager";
|
import { RandomManager } from "db://oops-framework/core/common/random/RandomManager";
|
||||||
import { oops } from "db://oops-framework/core/Oops";
|
import { oops } from "db://oops-framework/core/Oops";
|
||||||
|
import { HeroModelComp } from "../hero/HeroModelComp";
|
||||||
|
import { HeroViewComp } from "../hero/HeroViewComp";
|
||||||
|
|
||||||
const { ccclass, property } = _decorator;
|
const { ccclass, property } = _decorator;
|
||||||
|
|
||||||
@@ -55,7 +57,19 @@ export class CardComp extends CCComp {
|
|||||||
const sprite = show.getChildByName("mask").getChildByName("icon").getComponent(Sprite);
|
const sprite = show.getChildByName("mask").getChildByName("icon").getComponent(Sprite);
|
||||||
sprite.spriteFrame = atlas.getSpriteFrame(HeroInfo[uuid].path);
|
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(){
|
use_card(){
|
||||||
if(this.is_used) return
|
if(this.is_used) return
|
||||||
|
|||||||
Reference in New Issue
Block a user