Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


PackageInfo

Structure describing a Unity package.
Read time 2 minutesLast updated 10 days ago

Definition

public sealed class PackageInfo

Remarks

A reference to a package in a registry, a revision of a source repository, a resource on the internet, or a package available on disk.
using UnityEngine;using UnityEditor.PackageManager;using UnityEditor.PackageManager.Requests;[ExecuteInEditMode]public class PackageInfoExample : MonoBehaviour{ ListRequest m_ListRequest; void Start() { Debug.Log("Listing packages to get PackageInfo..."); m_ListRequest = Client.List(); } void Update() { if (m_ListRequest != null && m_ListRequest.IsCompleted) { if (m_ListRequest.Status == StatusCode.Success) { foreach (var packageInfo in m_ListRequest.Result) { Debug.Log($"Package Name: {packageInfo.name}"); Debug.Log($"Package Display Name: {packageInfo.displayName}"); // etc. } } else { Debug.Log($"Package list request failed: {m_ListRequest.Error}"); } m_ListRequest = null; } }}

Properties

Property

Description

assetPathThe asset path of the package in the AssetDatabase.
authorAn AuthorInfo instance of the author of the package.
categoryCategory of the package.
changelogUrlThe custom URL for the changelog for the package.
datePublishedThe date and time at which the package was published.
dependenciesAn array of DependencyInfos listing all the packages this package directly depends on.
deprecationMessageDeprecation message for the version that this instance represents.
descriptionDetailed description of the package.
displayNameFriendly display name of the package.
documentationUrlThe custom URL for documentation for the package.
errorsErrors that the Package Manager reports for this package.
gitA GitInfo instance providing detailed information for a Git package.
isDeprecatedSet to
true
if the package version that this instance represents is deprecated.
isDirectDependencyIf the package is a direct dependency of the project.
keywordsAn array of keywords associated with the package.
licensesUrlThe custom URL for the licenses of a package.
nameA read-only string property that contains the unique name of a package.
packageIdA read-only string property that provides the full package identifier, including the package name and version. For example, "com.unity.textmeshpro@3.0.6".
registryThe registry where the Package Manager might find this package.
repositoryA RepositoryInfo instance containing information the repository that the package is hosted on.
resolvedDependenciesAn array of DependencyInfo instances listing all the packages this package directly or indirectly depends on and the versions they resolved to.
resolvedPathThe local path of the package on disk.
sourceSource of the package contents.
typeType of the package.
versionVersion of the package.
versionsA VersionsInfo instance containing information about the available versions of the package.

Static Methods

Method

Description

FindForAssemblyRetrieves information about the package containing an assembly, or the assembly definition used to build that assembly.
FindForAssetPathRetrieves information about the package containing an asset based on the path of that asset.
FindForPackageNameRetrieves information about the package based on the name of that package.
GetAllRegisteredPackagesRetrieves information about all packages that are currently loaded.
IsPackageRegisteredChecks if a specific package is registered with the AssetDatabase.