This commit is contained in:
2024-08-13 23:34:49 +08:00
parent 876a56c8c1
commit 0c2cc741d7
39 changed files with 2935 additions and 2485 deletions

View File

@@ -34,17 +34,17 @@ export class HeroCard extends ecs.Entity {
load(pos: Vec3 = Vec3.ZERO,uuid:number=1001,parent:Node) {
// console.log("load hero",uuid);
// var path = "game/monster/"+prefab_path;
var path = "game/heros/cards/hero_card";
var path = "game/heros/hero_card";
var prefab: Prefab = oops.res.get(path, Prefab)!;
var node = instantiate(prefab);
node.parent = parent;
// node.getChildByName("avatar").setScale(node.getChildByName("avatar").scale.x*camp, node.getChildByName("avatar").scale.y, node.getChildByName("avatar").scale.z);
node.setPosition(pos)
const url = 'game/heros/hero/heros';
const url = 'game/heros/heros';
resources.load(url, SpriteAtlas, (err: any, atlas) => {
const sprite = node.getChildByName("hero").getComponent(Sprite);
sprite.spriteFrame = atlas.getSpriteFrame(CardSet[uuid].prefab_path);
sprite.spriteFrame = atlas.getSpriteFrame(CardSet[uuid].uuid);
});
var hcv = node.getComponent(HeroCardViewComp)!;