When you have the Addressables Groups window open in the editor, you can choose a “Simplify Addressable Names” option by right clicking that shortens the name of all assets in your Addressable Group to the smallest name possible (hides path, extensions, etc). VERY handy.
My question: Is this function accessible from code? I have been able to, in code, create an Addressable Group and load assets into it, but so far I have not found the way to execute the simplify feature on the newly created group.
I’ve tried finding a method to use in the AddressableAssetSettings and AddressableAssetGroup classes, but can’t find anything relevant…
You can find the function call inside Packages/com.unity.addressables/Editor/GUI/AddressableAssetsSettingsGroupTreeView.cs/.
Which is called SimplifyAddresses(object conext) which you can check out
var e = settings.CreateOrMoveEntry(guid, group, false, false);
if(!string.IsNullOrEmpty(label))
e.SetLabel(label, true);
if (simplifyNames)
e.SetAddress(e.MainAsset.name);