再次清理英雄,切换到像素
This commit is contained in:
@@ -157,36 +157,36 @@ export class CardComp extends CCComp {
|
||||
this.do_card_bg_show(HeroInfo[uuid].quality)
|
||||
show.getChildByName("coins").active=false
|
||||
var icon_path = "game/heros/heros/"+HeroInfo[uuid].path
|
||||
resources.load(icon_path, sp.SkeletonData, (err, skeleton) => {
|
||||
if (err) {
|
||||
console.error("[CardComp]: 加载骨骼数据失败:", err);
|
||||
return;
|
||||
}
|
||||
console.log("[CardComp]: 加载骨骼数据成功:", skeleton)
|
||||
// 检查节点是否仍然存在
|
||||
const maskNode = show.getChildByName("mask");
|
||||
if (!maskNode) {
|
||||
console.error("[CardComp]: mask节点不存在");
|
||||
return;
|
||||
}
|
||||
// resources.load(icon_path, sp.SkeletonData, (err, skeleton) => {
|
||||
// if (err) {
|
||||
// console.error("[CardComp]: 加载骨骼数据失败:", err);
|
||||
// return;
|
||||
// }
|
||||
// console.log("[CardComp]: 加载骨骼数据成功:", skeleton)
|
||||
// // 检查节点是否仍然存在
|
||||
// const maskNode = show.getChildByName("mask");
|
||||
// if (!maskNode) {
|
||||
// console.error("[CardComp]: mask节点不存在");
|
||||
// return;
|
||||
// }
|
||||
|
||||
const heroNode = maskNode.getChildByName("hero");
|
||||
if (!heroNode) {
|
||||
console.error("[CardComp]: hero节点不存在");
|
||||
return;
|
||||
}
|
||||
// const heroNode = maskNode.getChildByName("hero");
|
||||
// if (!heroNode) {
|
||||
// console.error("[CardComp]: hero节点不存在");
|
||||
// return;
|
||||
// }
|
||||
|
||||
const spine = heroNode.getComponent(sp.Skeleton);
|
||||
if (!spine) {
|
||||
console.error("[CardComp]: hero节点上没有找到SkinnedMeshRenderer组件");
|
||||
return;
|
||||
}
|
||||
// const spine = heroNode.getComponent(sp.Skeleton);
|
||||
// if (!spine) {
|
||||
// console.error("[CardComp]: hero节点上没有找到SkinnedMeshRenderer组件");
|
||||
// return;
|
||||
// }
|
||||
|
||||
if (spine) {
|
||||
spine.skeletonData = skeleton;
|
||||
spine.setAnimation(0, "Idle", true);
|
||||
}
|
||||
});
|
||||
// if (spine) {
|
||||
// spine.skeletonData = skeleton;
|
||||
// spine.setAnimation(0, "Idle", true);
|
||||
// }
|
||||
// });
|
||||
// resources.load(icon_path, SpriteAtlas, (err: any, atlas) => {
|
||||
// const sprite = show.getChildByName("mask").getChildByName("hero").getComponent(Sprite);
|
||||
// sprite.spriteFrame = atlas.getSpriteFrame(HeroInfo[uuid].path);
|
||||
|
||||
Reference in New Issue
Block a user