Getting adress of ScriptableObject marked as Addressable from reference

So I have a ScriptableObject that I mark as Addressable and create a string that’s address for it like “Assets/Data/SO_Scriptableobjectname”
Now I just do this:

public ScriptableObject soName;

And hook up reference to that Scriptable object in editor.

How can I get from that reference the Addressable address string?

I think you have the wrong idea about addressables. As you’ve done now is just normal referencing.

If you want to load via addressables, you use AssetReference or its siblings. Start here: Getting started | Addressables | 1.20.5

No that is not what I need.
It’s very simple. I have a reference to Scriptable Object like this:

How can I get from this reference an Addressable address of this Scriptable Object? So essentially this string next to Adressable checkbox:

1 Like

What do you need the addressable address for?

That information can only be retrieved at editor time with something like UnityEditor.AddressableAssets.AddressableAssetSettingsDefaultObject.Settings.FindAssetEntry or similar.

Edit: Besides, the address doesn’t mean much. Assets are loaded from addressables via their guid.

Thank you - I’ve used:
UnityEditor.AddressableAssets.AddressableAssetSettingsDefaultObject.Settings.FindAssetEntry(AssetDatabase.AssetPathToGUID(AssetDatabase.GetAssetPath(scriptableObject))).ToString();

I needed addressable address for XML serialization of scriptable objects so I can convert SO > XML and other way around without loosing references. It’s for custom editor script. I couldn’t use Identifier since those change each time you reset unity so I figured saving addressable address would be the way to go.
I probably could use guid but then whoever reads/edits xml woudn’t know what it’s refering to so addressable address was used as more human readable form.

Hello! Any idea how I could do this in build? I need to save an inventory’s content (scriptable objects) to a local file

I made a custom SO for this that saves a guid field at edit time. You just get the file guid in onValidate using AssetDatabase API. It doesn’t get lost as long as you serialize the guid field. Then you can use the guid in place of the address to load the SO via addressables