技能运动需要完善

This commit is contained in:
2024-09-12 11:14:37 +08:00
parent a847611240
commit 1c9aa38385
212 changed files with 531 additions and 62599 deletions

View File

@@ -236,8 +236,8 @@ export class CardControllerComp extends CCComp {
load_cards() {
this.in_load = true
let card:any=null
for (let index = 1; index <= 6; index++) {
card=RandomManager.instance.getRandomByObjectList(CardList[index], 1);
for (let index = 1; index <= 4; index++) {
card=RandomManager.instance.getRandomByObjectList(smc.cards, 1);
this.cards[index].uuid=card[0].uuid
this.cards[index].type=card[0].type
@@ -246,20 +246,31 @@ export class CardControllerComp extends CCComp {
let name: string = "";
let level: number = 0;
let { uuid, type } = card[0];
switch (type) {
case 1:
url = "game/hero/hero_icon";
({ uuid: pathName, name, level } = smc.heros[uuid]);
break;
case 2:
url = "game/heros/skill";
({ path: pathName, name, level } = smc.skills[uuid]);
break;
case 3:
default:
url = "game/heros/skill";
({ path: pathName, name, level } = smc.skills[uuid]);
}
url = "game/hero/hero_icon";
({ uuid: pathName, name, level } = smc.heros[uuid]);
this.cards[index].lv=level
let node=this.node.getChildByName('cards').getChildByName('card'+index)
node.getChildByName('cost').getComponent(Label).string=level.toString()
node.getChildByName('name').getComponent(Label).string=name
// const sprite = node.getChildByName("item").getComponent(Sprite);
// console.log(this['card'+index],url,pathName,sprite)
resources.load(url, SpriteAtlas, (err: any, atlas) => {
const sprite = node.getChildByName("item").getComponent(Sprite);
sprite.spriteFrame = atlas.getSpriteFrame(pathName);
});
this.cards[index].alive=true
}
for (let index = 5; index <= 6; index++) {
card=RandomManager.instance.getRandomByObjectList(CardList[index], 1);
this.cards[index].uuid=card[0].uuid
this.cards[index].type=card[0].type
let url: string = "";
let pathName: string = "";
let name: string = "";
let level: number = 0;
let { uuid, type } = card[0];
url = "game/heros/skill";
({ path: pathName, name, level } = smc.skills[uuid]);
this.cards[index].lv=level
let node=this.node.getChildByName('cards').getChildByName('card'+index)
node.getChildByName('cost').getComponent(Label).string=level.toString()