ParagonPaths

Static path registry providing strongly-typed access to all standard workspace, project, and asset folder paths. Uses a nested Folder class hierarchy with implicit string conversion for seamless use in file I/O operations.

Definition

Namespace: Paragon Assembly: Paragon.dll

[RuntimeInitializeOnLoad]
public static class ParagonPaths

Attributes: [RuntimeInitializeOnLoad], [InitializeOnLoad] (Editor)

Remarks

ParagonPaths is the single source of truth for file system paths in the Paragon framework. Rather than scattering string literals like "Assets/Paragon/Core" throughout the codebase, all paths are accessed through a strongly-typed Folder hierarchy that mirrors the project's directory structure.

Initialization

The class is marked with [RuntimeInitializeOnLoad] (Paragon's custom attribute), which forces its static constructor to run at application startup. In the Editor, [InitializeOnLoad] provides the same guarantee. The static constructor:

  1. Detects the OS platform (Unix vs Windows)

  2. Resolves the user's Documents folder

  3. Builds the full folder hierarchy: Documents/Paragon Entertainment/[ProjectName]/...

Folder Hierarchy

Implicit String Conversion

Every Folder instance implicitly converts to string, so paths can be passed directly to any API expecting a path string:

Quick Lookup

Goal
How

Get workspace root

ParagonPaths.Workspace

Get project root

ParagonPaths.Project

Get Assets folder

ParagonPaths.Assets

Get Paragon Core folder

ParagonPaths.Assets.Paragon.Core

Get Paragon Editor folder

ParagonPaths.Assets.Paragon.Editor

Get Build/Resources

ParagonPaths.Assets.Build.Resources

Get game-specific folder

ParagonPaths.Assets.Game

Combine with child path

ParagonPaths.Assets.Combine("MyFolder/file.txt")

Get full system path

ParagonPaths.Project.GetFullPath()

Get folder name only

ParagonPaths.Assets.GetFolderName()"Assets"

Properties

Property
Type
Access
Description

Workspace

WorkspaceFolder

public static

Root workspace folder (Documents/Paragon Entertainment)

Project

ProjectFolder

public static

Project root (workspace + project directory name)

Assets

AssetsFolder

public static

Unity Assets folder

Nested Classes

Folder

Base class for all folder types. Stores a path string and provides utility methods.

Member
Type
Description

path

string

Protected path string

Folder(string name)

Constructor

Creates from a name (relative path)

Folder(string directory, string name)

Constructor

Creates from parent directory + name

implicit operator string

Operator

Returns the path string

GetFolderName()

string

Returns just the folder name

GetFullPath()

string

Returns the absolute path

Combine(string childPath)

string

Joins with a child path

ToString()

string

Returns the path string

WorkspaceFolder : Folder

Member
Type
Description

Project

ProjectFolder

The project folder within this workspace

ProjectFolder : Folder

Member
Type
Description

Assets

AssetsFolder

Unity Assets folder

Packages

Folder

Unity Packages folder

Build

Folder

Build output folder

ThirdParty

Folder

Third-party dependencies

ProjectSettings

Folder

Unity ProjectSettings

Library

Folder

Unity Library (cache)

Temp

Folder

Unity Temp folder

AssetsFolder : Folder

Member
Type
Description

Paragon

ParagonFolder

Assets/Paragon folder

Build

BuildFolder

Assets/Build folder

ThirdParty

Folder

Assets/Third-Party folder

Game

Folder

Assets/[ProductName] folder (uses Application.productName)

ParagonFolder : Folder

Member
Type
Description

Core

Folder

Assets/Paragon/Core

Editor

Folder

Assets/Paragon/Editor

BuildFolder : Folder

Member
Type
Description

Resources

Folder

Assets/Build/Resources

Common Pitfalls

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

Examples

Accessing Common Paths

Combining Paths

Using in File Operations

See Also

Last updated