Version: Unity 6.2 (6000.2)
LanguageEnglish
  • C#

RepositoryInfo

class in UnityEditor.PackageManager

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

Description

Information about a repository that contains the source code of a package, including the repository type and URL.

  • This information is used mostly with Git repositories.
  • All the properties can be null, for example when the repository information is not provided.
using UnityEngine;
using UnityEditor.PackageManager;
using UnityEditor.PackageManager.Requests;

[ExecuteInEditMode] public class PackageRepositoryInfoExample : MonoBehaviour { ListRequest m_ListRequest; void Start() { Debug.Log("Listing packages and getting their repository 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) { var outputString = $"Dependencies for {package.name}:"; if (package.repository != null) { Debug.Log($"Repository info for {package.name}:" + $"\n- Type: {package.repository.type}" + $"\n- URL: {package.repository.url}" + (string.IsNullOrEmpty(package.repository.revision) ? "" : $"\n- Revision: {package.repository.revision}")); } } } m_ListRequest = null; } } }

Related information

Properties

Property Description
pathThe relative path to the package root in the repository, if it is different from the repository root.
revisionThe revision id corresponding to the package version.
typeThe type of the repository, e.g. git.
urlThe url to the source code repository.