Version: Unity 6.2 (6000.2)
LanguageEnglish
  • C#

PackageInfo.GetAllRegisteredPackages

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Switch to Manual

Declaration

public static PackageInfo[] GetAllRegisteredPackages();

Returns

PackageInfo[] The array of PackageInfo instances describing each package.

Description

Retrieves information about all packages that are currently loaded.

  • The results include all packages in the current project, regardless of the package source.
  • This method returns cached information, which might not reflect recent changes.
  • This method is more efficient than Client.List for quick package checks.
using UnityEngine;
using UnityEditor.PackageManager;
[ExecuteInEditMode]
public class PackageManagerRegisteredExample : MonoBehaviour
{
    void Start()
    {
        Debug.Log("GetAllRegisteredPackages example...");
        ListRegisteredPackages();
    }

void ListRegisteredPackages() { PackageInfo[] packages = PackageInfo.GetAllRegisteredPackages(); Debug.Log($"Found {packages.Length} registered packages:"); foreach (var package in packages) { Debug.Log($"- {package.name}" + $"\n Version: {package.version}" + $"\n Source: {package.source}"); } } }

Related information