Search Unity

Question How do I get the prefab name from an asset reference?

Discussion in 'Addressables' started by wwaero, Jun 5, 2020.

  1. wwaero

    wwaero

    Joined:
    Feb 18, 2020
    Posts:
    42
    I'm having some trouble trying to translate from my list of AssetReferences in a build to the name of the prefab which is addressable. I'm trying to get this name so the user can choose what they want to load from a dropdown list.

    In the editor i can use
    assetReferences.editorAsset.name

    what do i use in a build?
     
    dfarjoun likes this.
  2. wwaero

    wwaero

    Joined:
    Feb 18, 2020
    Posts:
    42
    I'm just trying to get a list of the assets with their prefab name before loading them in.
     
  3. ProtoTerminator

    ProtoTerminator

    Joined:
    Nov 19, 2013
    Posts:
    586
    You can't get the object's name without loading in the object. You'll have to store that information in another manner to be able to use it before loading the object.