ThirdPartyPackageManifest
Parses and creates UPM-style package.json manifests for third-party packages. Automatically discovers existing manifests from Third-Party/ folders at editor startup and provides static lookup by package name or path.
Definition
Namespace: Paragon.Editor.ThirdPartyPackageImporter Assembly: Paragon.Editor.dll
internal class ThirdPartyPackageManifestRemarks
ThirdPartyPackageManifest wraps a JObject (Newtonsoft.Json) to read and write package.json fields. It serves two purposes:
Discovery — The static constructor scans
Third-Party/andAssets/Third-Party/for all existingpackage.jsonfiles, parses them, validates them, and stores them in a static dictionary keyed by package name.Creation —
CreateAtPath()generates a new manifest with standard UPM fields and writes it to disk.
Discovery Process
Manifest Fields
All properties are backed by JObject key lookups using nameof(), mapping directly to standard package.json fields:
name
"name"
"com.third-party.synty-polygon"
displayName
"displayName"
"POLYGON Fantasy"
version
"version"
"1.0.0"
versionString
"versionString"
"1.0"
unity
"unity"
"2022.3"
description
"description"
"Low poly fantasy asset pack"
category
"category"
"Tool"
author
"author"."name"
"Third-Party"
Quick Lookup
Check if a manifest exists by name
ThirdPartyPackageManifest.TryGetManifest("com.pkg.name", out manifest)
Check if a manifest exists at path
ThirdPartyPackageManifest.TryGetManifestAtPath(fullPath, out manifest)
Create a new manifest
ThirdPartyPackageManifest.CreateAtPath(path, name, displayName, ...)
Validate a manifest
ThirdPartyPackageManifest.IsValid(manifest)
Get the manifest's folder
manifest.GetManifestFolderPath()
Properties
name
string
public get / private set
UPM package name (e.g., com.third-party.package)
displayName
string
public get / private set
Human-readable display name
version
string
public get / private set
SemVer version string
versionString
string
public get / private set
Shortened version string
unity
string
public get / private set
Minimum Unity version (e.g., "2022.3")
description
string
public get / private set
Package description
category
string
public get / private set
Package category
author
string
public get / private set
Author name (nested under "author"."name" in JSON)
Static Methods
CreateAtPath
Creates a new manifest at the specified path, adds it to the static dictionary, and writes it to disk.
path
string
Directory path where package.json will be created
name
string
UPM package name
displayName
string
Human-readable display name
version
string
SemVer version
versionString
string
Shortened version string
description
string
Package description
unity is auto-populated from Application.unityVersion (major.minor only). category defaults to "Tool" and author defaults to "Third-Party".
TryGetManifest
Looks up a manifest by its UPM package name.
packageName
string
The name field of the manifest (e.g., "com.third-party.synty")
manifest
out ThirdPartyPackageManifest
The found manifest, or null
TryGetManifestAtPath
Looks up a manifest by its folder path (linear scan).
path
string
Full path to the manifest's folder
manifest
out ThirdPartyPackageManifest
The found manifest, or null
IsValid
Validates that all required fields are non-null and non-empty.
Required fields: name, displayName, version, versionString, unity, description, category, author.
Instance Methods
GetManifestFolderPath
Returns the directory path containing this manifest's package.json.
Common Pitfalls
Static constructor scans filesystem The static constructor calls Directory.GetFiles() on Third-Party/ and Assets/Third-Party/ directories. If these directories don't exist, no error is thrown — but the manifest dictionary will be empty.
TryGetManifestAtPath is O(n) Unlike TryGetManifest (dictionary lookup by name), TryGetManifestAtPath does a linear scan via FirstOrDefault. For frequent lookups by path, this may be a concern with large numbers of manifests.
CreateAtPath overwrites existing entries If a manifest with the same name already exists in the static dictionary, CreateAtPath replaces it silently (manifests[name] = manifest). The old file on disk is also overwritten.
Author property nests into JSON The author property reads/writes jsonObject["author"]["name"], creating an intermediate JObject if needed. This matches the UPM package.json format where author is an object with a name field.
See Also
ThirdPartyPackageManager — uses manifests to determine installed versions
ThirdPartyPackageUtility — catalog download and caching
ThirdPartyPackageManager Overview — system overview
Last updated