Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question Addressable in Image Component

Discussion in 'Addressables' started by EwertonBR, May 31, 2022.

  1. EwertonBR

    EwertonBR

    Joined:
    Feb 7, 2018
    Posts:
    16
    What happens if I mark a Sprite as Addressable and reference it in an Image component. The Unity understands that this sprite is an Addressable
     
  2. Akuramuzda

    Akuramuzda

    Joined:
    Apr 26, 2021
    Posts:
    5
  3. pillakirsten

    pillakirsten

    Unity Technologies

    Joined:
    May 22, 2019
    Posts:
    346
    Hi @EwertonBR at the moment knowing if an asset is "addressable" is only known by the Addressables System not Unity. The Image component will reference the Sprite asset itself rather than the version of the Sprite that is packed into an AssetBundle.

    You can use AssetReference to store a reference to the addressable Sprite. Then at runtime, use Addressables to load the Sprite from the AssetReference. From there you can make the Image component reference the loaded Sprite.
    https://docs.unity3d.com/Packages/com.unity.addressables@1.20/manual/AssetReferences.html
     
  4. EwertonBR

    EwertonBR

    Joined:
    Feb 7, 2018
    Posts:
    16