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