refactor(ui): 统一技能图标图集缓存逻辑
将技能图标加载从通用uiconsAtlas拆分到专属skillIconsAtlas, 在SinfoComp、SSkillBoxComp、TalentItemComp中替换图集引用, 并添加对应注释明确图集使用范围。
This commit is contained in:
@@ -91,11 +91,11 @@ export class TalentItemComp extends CCComp {
|
||||
// 阶位背景:激活对应颜色子节点(Ⅰ蓝 / Ⅱ红 / Ⅲ金)
|
||||
if (this.bg) this.applyTierBg(cfg.tier, inactive);
|
||||
|
||||
// 图标:uiconsAtlas 优先,资源目录回退(与 TalentItemComp 旧版/SCardComp 口径一致)
|
||||
// 图标:技能图标图集(gui/ui7)优先,资源目录回退(与 SCardComp 口径一致)
|
||||
if (this.icon && cfg.icon) {
|
||||
let frame: SpriteFrame | null = null;
|
||||
if (smc.uiconsAtlas) {
|
||||
frame = smc.uiconsAtlas.getSpriteFrame(cfg.icon);
|
||||
if (smc.skillIconsAtlas) {
|
||||
frame = smc.skillIconsAtlas.getSpriteFrame(cfg.icon);
|
||||
}
|
||||
if (!frame) {
|
||||
frame = oops.res.get("game/heros/cards/" + cfg.icon, SpriteFrame) as SpriteFrame;
|
||||
|
||||
Reference in New Issue
Block a user