Search Unity

[feature request] rename label.

Discussion in 'Addressables' started by Favo-Yang, Jun 18, 2019.

  1. Favo-Yang

    Favo-Yang

    Joined:
    Apr 4, 2011
    Posts:
    464
    Seems no way to rename a label so far?
     
  2. unity_bill

    unity_bill

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    not yet. it's on the list.
     
  3. suiboli

    suiboli

    Joined:
    Mar 27, 2020
    Posts:
    11
    Any Updates?
     
  4. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    668
    This would be a fantastic feature to have!
     
  5. davidla_unity

    davidla_unity

    Unity Technologies

    Joined:
    Nov 17, 2016
    Posts:
    763
    Hey all, sorry for the delay. This actually got removed from the list because of our backlog getting overwhelmingly large at one point and we had to cut things that weren't high priority. We're in a much more manageable state and will add it back to the list since it seems like there's still interest in having this feature. I'll make a ticket right after posting this and we'll try to have it pretty quick for you all.
     
    suiboli likes this.
  6. summitsteven

    summitsteven

    Joined:
    Nov 21, 2018
    Posts:
    3
    I built some scripts that adjust labels as part of my build process. Here's a rough example that would add labels to every addressable asset:

    Code (CSharp):
    1. var settings = AddressableAssetSettingsDefaultObject.Settings;
    2.  
    3.         foreach (var grp in settings.groups)
    4.         {
    5.             foreach (var entry in grp.entries)
    6.             {
    7.  
    8.                 entry.SetLabel("something", true, true, false);
    9.  
    10.             }
    11.         }
    The second argument in SetLabel would remove the label if set to false, so you could do a check on the asset to see if it had the first label (entry.labels), then remove the first label and add the new label.

    you may need to do a settings.SetDirty(...) to make it stick, but I'm not 100% sure about that.