Как проверить, есть ли файл в Addressable?
Нужно проверить, есть ли файл с определенным названием в Addressable. То, что я пробовал:
public bool AddressableResourceExists(object key)
{
foreach (var l in Addressables.ResourceLocators)
{
IList<IResourceLocation> locs;
if (l.Locate(key, typeof(TextAsset), out locs))
return true;
}
return false; // всегда возвращает false
}
var selectMany = Addressables.ResourceLocators.OfType<ResourceLocationMap>()
.SelectMany(locationMap =>
locationMap.Locations.Keys.Select(key => key.ToString())
); // всегда пустой