Contains information about the package registry from which a package was installed, including the registry name and URL.
RegistryInfo
instance from the registry
property of a PackageInfo object.using System; using UnityEngine; using UnityEditor.PackageManager; using UnityEditor.PackageManager.Requests;
[ExecuteInEditMode] public class RegistryInfoExample : MonoBehaviour { ListRequest m_ListRequest; void Start() { Debug.Log("Listing packages and getting their registry info..."); m_ListRequest = Client.List(); }
void Update() { if (m_ListRequest != null && m_ListRequest.IsCompleted) { if (m_ListRequest.Status == StatusCode.Success) { foreach (var package in m_ListRequest.Result) { Debug.Log($"Registry info for {package.name}:\n" + $"- Registry name: {package.registry.name}\n" + $"- Registry URL: {package.registry.url}\n" + $"- Is default registry: {package.registry.isDefault}"); } } else { Debug.Log($"Package list request failed: {m_ListRequest.Error}"); } m_ListRequest = null; } } }
Related information