Search Unity

Bug AssetDatabase.SetLabels not working.

Discussion in 'Editor & General Support' started by arkano22, Jan 31, 2023.

  1. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    1,928
    Unity 2021.3.3f1:

    Code (CSharp):
    1.  
    2. AssetDatabase.SetLabels(asset, new string[]{"MyLabel"});
    3. var labels = AssetDatabase.GetLabels(asset);
    4. Debug.Log(labels.Length);
    5.  
    Always prints zero. I'm completely unable to set labels programmatically. Anyone encountered this before? Am I using the API incorrectly?