Search Unity

AssetReference name ?

Discussion in 'Addressables' started by waterbearpaul, Sep 11, 2018.

  1. waterbearpaul

    waterbearpaul

    Joined:
    May 23, 2017
    Posts:
    5
    Hello there!

    I have a project in which I mix Photon and Addressables.
    To spawn an object, I send an RPC with the ID of the AssetReference to instantiate.
    I am currently using RuntimeKey as an ID but I am not sure it's truly unique and always the same in all cases on all platforms.

    Ideally I would like to send the name of the GameObject which the AssetReference refers to.
    But this field is gone since preview 0.2.2 if my memory is right.
    Do you have a workaround ?

    Thanks.
     
  2. unity_bill

    unity_bill

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    The RuntimeKey is the GUID of the object, so it is always unique. That is the only thing the AssetReference keeps up with to know how to load the asset at runtime. The class does also store some extra data, but it's only for in-editor to make things run a little more efficiently.

    Not sure if that covers all you were having trouble with. If there is more to this, please let me know.

    -Bill
     
  3. waterbearpaul

    waterbearpaul

    Joined:
    May 23, 2017
    Posts:
    5
    Thank you.
    As long as I can use safely the RuntimeKey, it's ok.