ThirdPartyPackageUtility

Static utility class that downloads catalog and processor table data from Google Sheets, manages local disk caching, and provides file enumeration helpers for the third-party package system.

Definition

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

internal static class ThirdPartyPackageUtility

Remarks

ThirdPartyPackageUtility is the I/O backbone of the third-party package system. It handles:

  1. Remote data download — Fetches CSV data from a Google Sheets spreadsheet using UnityWebRequest

  2. Local caching — Stores downloaded data in Application.persistentDataPath/Third-Party Packages/

  3. Deserialization — Parses CSV text into typed objects (ThirdPartyPackageCatalog and ProcessorTable)

  4. File enumeration — Lists file and directory names in a folder, filtering out .meta files

Google Sheets Integration

The catalog and processor tables are stored as sheets in a single Google Sheets document. Each sheet is exported as CSV using the URL pattern:

https://docs.google.com/spreadsheets/d/{document_id}/export?gid={sheet_id}&format=csv
  • Sheet GID 0 — The main catalog (one row per package)

  • Sheet GID {CatalogID} — Per-package processor table (rename/remap rules)

Caching Strategy

spinner

CSV Format — Catalog

The first row is a header (skipped). ImportFolder values have "Assets" replaced with "Assets/Third-Party" during deserialization.

CSV Format — ProcessorTable

Context headers start with $ and have empty values. Variables are expanded into DIRECTORIES and FILES contexts.

Quick Lookup

Goal
How

Download fresh catalog

var catalog = await ThirdPartyPackageUtility.DownloadCatalog()

Load cached catalog

var catalog = ThirdPartyPackageUtility.LoadCatalog()

Load processor table for package

var table = await ThirdPartyPackageUtility.LoadProcessorTable(packageID)

List files in a folder

ThirdPartyPackageUtility.GetAllFileNamesInFolder(path)

Get the Google Sheets URL

ThirdPartyPackageUtility.GetDocumentUrl()

Fields

Field
Type
Description

google_sheets_url

const string

Base URL: "https://docs.google.com/spreadsheets/d"

export_url

const string

Export format string: "{0}/export?gid={1}&format=csv"

document_id

const string

The Google Sheets document ID (hardcoded)

documentUrl

static readonly string

Full document URL (constructed at static init)

cacheFolder

static readonly string

Application.persistentDataPath/Third-Party Packages/

filteredExtensions

static readonly string[]

Extensions to exclude from file enumeration ([".meta"])

Methods

DownloadCatalog

Downloads the catalog sheet (GID 0) from Google Sheets, caches it to disk, and returns the deserialized catalog.

LoadCatalog

Loads the catalog from the local disk cache. Returns null if no cache file exists.

LoadProcessorTable

Downloads or loads a cached processor table for a specific package. Automatically cleans up stale cache files (same CatalogID, different Hash). Registers the table with ThirdPartyPackageProcessor.

Parameter
Type
Description

packageID

int

Asset Store ProductID — used to look up the package's CatalogID and Hash

GetAllFileNamesInFolder

Returns all file names (without extension) and relative directory paths in the given folder, excluding .meta files. Returns empty if the path doesn't exist.

Parameter
Type
Description

path

string

Absolute path to the folder to enumerate

GetDocumentUrl

Returns the full Google Sheets document URL.

Common Pitfalls

circle-exclamation
circle-exclamation
circle-exclamation
circle-exclamation
circle-exclamation

See Also

Last updated