Method GetLocatorInfo
GetLocatorInfo(string)
Given the Id of an IResourceLocator, get the relevant content catalog data associated with it.
선언
public static ResourceLocatorInfo GetLocatorInfo(string locatorId)
파라미터
타입 | 이름 | 설명 |
---|---|---|
string | locatorId | The identifier of an IResourceLocator used to retrieve content catalog data. |
반환
타입 | 설명 |
---|---|
ResourceLocatorInfo | Container for content catalog data pertaining to the IResourceLocator object. |
참고
Retrieves the content catalog data associated with the specified IResourceLocator id. The catalog data is stored as a ResourceLocatorInfo object.
예
The example below uses the identifiers of the resource locators loaded during Addressables initialization process to retrieve catalog data.
IEnumerator UsingGetLocatorInfoSampleId()
{
yield return Addressables.InitializeAsync();
IEnumerable<IResourceLocator> resourceLocators = Addressables.ResourceLocators;
foreach (IResourceLocator locator in resourceLocators)
{
// Call GetLocatorInfo using the locator id
ResourceLocatorInfo locatorInfo = Addressables.GetLocatorInfo(locator.LocatorId);
if (locatorInfo != null && locatorInfo.CatalogLocation != null)
{
if (locatorInfo.CanUpdateContent)
Debug.Log($"Locator {locator.LocatorId} was loaded from an UPDATABLE catalog with internal id : {locatorInfo.CatalogLocation.InternalId}");
else
Debug.Log($"Locator {locator.LocatorId} was loaded from an NON-UPDATABLE catalog with internal id : {locatorInfo.CatalogLocation.InternalId}");
}
else
{
Debug.Log($"Locator {locator.LocatorId} is not associated with a catalog");
}
}
}
GetLocatorInfo(IResourceLocator)
Given an IResourceLocator, get the relevant content catalog data associated with it.
선언
public static ResourceLocatorInfo GetLocatorInfo(IResourceLocator locator)
파라미터
타입 | 이름 | 설명 |
---|---|---|
IResourceLocator | locator | The resource locator you want to get content catalog data for. |
반환
타입 | 설명 |
---|---|
ResourceLocatorInfo | Container for content catalog data pertaining to the IResourceLocator object. |