I’m migrating a project that previously used direct references to using Addressables. To help migrate things, I build some quick tools to walk through the data-set and check if there’s an equivalently named Addressable. This of course assumes that the addressable already exists, and that the name is the same.
[Serializable]
public class AssetReferenceSprite : AssetReferenceT<Sprite>
{
public AssetReferenceSprite(string guid) : base(guid) { }
public bool isSet { get { return RuntimeKeyIsValid(); } }
}
public class Bar
{
[SerializeField] Sprite foo; // legacy
[SerializeField] AssetReferenceSprite fooRef; // copy legacy to here
}
I’ve dug out the AddressableAssetEntry from the database ; that part is simple enough.
So I have the GUID. How do I go from that, to an AssetReferenceT ?