Steps to reproduce:
- Open the attached project
- Check out the somemenu.uxml file
It has two Visual Element items. The bottom one had its icon set via the object picker using the UI Builder. The top one had its icon path specified manually inside the .uxml file:
<ui:VisualElement name="shop-gem-icon1" picking-mode="Ignore" style="width: 100px; height: 100px; background-image: url('project://database/Assets/UI_atlas.psd#icon_rarity_01'); -unity-background-scale-mode: scale-to-fit;" />
This path corresponds to the sub-asset name under UI_atlas.psd.
However, upon expanding UI_atlas in the Project Window, we discover that there are two types of assets available under identical names. One set is loaded as GameObjects and the other one as Sprites.
The asset type this .uxml is looking for is Sprite, but it somehow picks up the GameObject version first. It results in the following error:
Assets/somemenu.uxml (line 2): warning: Unsupported type GameObject for asset at path 'Assets/UI_atlas.psd' ; only the following types are supported: Texture2D, RenderTexture, Sprite, VectorImage
Suggestion: verify the import settings of this asset.
Note 1: Specifying the type via an an attribute (e.g. type=3) does not fix it.
Note 2: This only reproduces when the .psd file is using the UnityEditor.U2D.PSD.PSDImporter post-processor. Using the default UnityEditor.TextureImporter will work correcly.
Expected result: it either is resolved automatically as a "best guess" or at least force-setting the type works.
Actual result: cannot get the correct sub asset because of how the PSDImporter post-processor sets up sprites.
Reproducible with: 2021.3.16f1, 2023.1.0a26