PackageSelectionObject

Internal proxy for Unity's UnityEditor.PackageManager.UI.Internal.PackageSelectionObject. Detects which package is currently selected in the Package Manager UI.

Definition

Namespace: Paragon.Editor.ThirdPartyPackageImporter.Internals Assembly: Paragon.Editor.dll

[InternalProxy("UnityEditor.PackageManager.UI.Internal.PackageSelectionObject", "UnityEditor.CoreModule")]
internal class PackageSelectionObject : InternalProxy<PackageSelectionObject>

Inheritance: InternalProxy<PackageSelectionObject>PackageSelectionObject

Remarks

PackageSelectionObject is used by PackageManagerExtension to determine which package is currently selected in Unity's Package Manager window. The static GetSelectedPackageObject() method scans Selection.objects for an object matching the internal type, then wraps it as a proxy to access the packageUniqueId.

This ID is then passed to ServicesContainer.PackageDatabase.GetPackage() to retrieve the full Package proxy.

Properties

packageUniqueId

public string packageUniqueId { get; }

The unique ID of the currently selected package. Used for lookup in PackageDatabase.

Constructors

PackageSelectionObject

Parameter
Type
Description

packageSelectionObject

Object

The internal Unity PackageSelectionObject instance (Unity Object)

Methods

GetSelectedPackageObject

Returns a proxy for the currently selected package object in Unity's Package Manager.

Returns: A PackageSelectionObject proxy, or null if no package is selected or the selected object is not a package selection.

circle-info

This method scans Selection.objects for the first object whose type matches UnityEditor.PackageManager.UI.Internal.PackageSelectionObject using IsOfType(). Returns null if no match.

See Also

Last updated