diff --git a/cocos/editor-support/fairygui/UIPackage.cpp b/cocos/editor-support/fairygui/UIPackage.cpp index 3ae022c..c731619 100644 --- a/cocos/editor-support/fairygui/UIPackage.cpp +++ b/cocos/editor-support/fairygui/UIPackage.cpp @@ -603,7 +603,9 @@ void UIPackage::loadAtlas(PackageItem* item) { TextureCache* textureCache = Director::getInstance()->getTextureCache(); Texture2D* tex = textureCache->getTextureForKey(item->file); - if (!tex) { + if (tex) { + item->texture = tex; + } else { tex = textureCache->addImage(item->file); if (!tex) { item->texture = _emptyTexture;