Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


PackageSource

This enumeration indicates the source from which a package was installed.
Read time 1 minuteLast updated 5 days ago

Definition

public enum PackageSource

Remarks

  • The source information can help you determine how a package was installed and how it can be updated.
  • You can modify embedded and local packages.
using System;using UnityEngine;using UnityEditor.PackageManager;using UnityEditor.PackageManager.Requests;[ExecuteInEditMode]public class PackageSourceExample : MonoBehaviour{ ListRequest m_ListRequest; void Start() { Debug.Log("Listing packages and getting their source..."); 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($"{package.name}: {package.source}"); } } else { Debug.Log($"Package list request failed: {m_ListRequest.Error}"); } m_ListRequest = null; } }}
Related information

Fields

Value

Description

BuiltInThe package is built-in and part of Unity.
EmbeddedThe package is embedded in the Unity project.
GitThe package is referenced directly by a Git URL.
LocalThe package is referenced by a local path.
LocalTarballThe package is referenced by a local path pointing to a GZip tarball file.
RegistryThe package is from a registry.
UnknownThe package source is unknown.