Skip to content

Commit

Permalink
update spriteFrame
Browse files Browse the repository at this point in the history
  • Loading branch information
yanOO1497 committed Sep 15, 2023
1 parent cb19c08 commit dac6cce
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions editor/inspector/assets/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ const imageTypeToName = {
raw: '',
texture: 'texture',
'normal map': 'normalMap',
'sprite-frame': 'texture',
'sprite-frame': 'spriteFrame',
'texture cube': 'textureCube',
}
};

exports.template = /* html */`
<div class="asset-image">
Expand Down Expand Up @@ -354,6 +354,10 @@ exports.methods = {
return;
}
let targetName = imageTypeToName[this.meta.userData.type];
if (targetName === 'spriteFrame') {
// change texture asset when import as sprite
targetName = 'texture';
}
const targetSubMetaKey = Editor.Utils.UUID.nameToSubId(targetName);
targetSubMetaKey && this.changeMipFilter(targetSubMetaKey);
}
Expand Down

0 comments on commit dac6cce

Please sign in to comment.