refactor(ui): 统一技能图标图集缓存逻辑

将技能图标加载从通用uiconsAtlas拆分到专属skillIconsAtlas,
在SinfoComp、SSkillBoxComp、TalentItemComp中替换图集引用,
并添加对应注释明确图集使用范围。
This commit is contained in:
panFD
2026-09-06 21:46:59 +08:00
parent 0066faea1e
commit 084187f924
6 changed files with 345 additions and 153 deletions

View File

@@ -361,8 +361,9 @@ export class SinfoComp extends CCComp {
if (!this.icon_node || !this.icon_node.isValid) return;
const iconId = p.card_icon ?? this.resolveIconId(p);
let sprite = this.icon_node.getComponent(Sprite) || this.icon_node.addComponent(Sprite);
if (smc.uiconsAtlas && iconId) {
const frame = smc.uiconsAtlas.getSpriteFrame(iconId);
// 技能图标统一走 gui/ui7 图集缓存
if (smc.skillIconsAtlas && iconId) {
const frame = smc.skillIconsAtlas.getSpriteFrame(iconId);
sprite.spriteFrame = frame || null;
} else {
sprite.spriteFrame = null;