docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method GetLocatorInfo

    GetLocatorInfo(string)

    Given the Id of an IResourceLocator, get the relevant content catalog data associated with it.

    Declaration
    public static ResourceLocatorInfo GetLocatorInfo(string locatorId)
    Parameters
    Type Name Description
    string locatorId

    The identifier of an IResourceLocator used to retrieve content catalog data.

    Returns
    Type Description
    ResourceLocatorInfo

    Container for content catalog data pertaining to the IResourceLocator object.

    Remarks

    Retrieves the content catalog data associated with the specified IResourceLocator id. The catalog data is stored as a ResourceLocatorInfo object.

    Examples

    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.

    Declaration
    public static ResourceLocatorInfo GetLocatorInfo(IResourceLocator locator)
    Parameters
    Type Name Description
    IResourceLocator locator

    The resource locator you want to get content catalog data for.

    Returns
    Type Description
    ResourceLocatorInfo

    Container for content catalog data pertaining to the IResourceLocator object.

    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)