RegistryInfo
Contains information about the package registry from which a package was installed, including the registry name and URL.
Read time 1 minuteLast updated 12 days ago
Definition
- Type: Class
- Namespace: UnityEditor.PackageManager
- Assembly: UnityEditor.CoreModule
public class RegistryInfo
Remarks
- You can get a instance from the
RegistryInfoproperty of a PackageInfo object.registry - Each package in your project tracks which registry it came from.
- Custom scoped registries can be configured in your project settings.
- The default Unity registry cannot be removed or modified.
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