EngineModule

Represents a single mountable engine module — a shared Plastic SCM repository that can be linked into the current project workspace via xlink or symlink. Tracks the module's repository, workspace, mount path, target path, and current mount state.

Definition

Namespace: Paragon.Editor.ModuleManager Assembly: Paragon.Editor.dll

[Serializable]
internal class EngineModule

Remarks

An EngineModule acts as the bridge between a Plastic SCM Repository and the project workspace. It stores the configuration for where in the project a module should be mounted (MountPath) and what part of the module's workspace to link (TargetPath).

Mount Strategies

Mount State
Mechanism
Typical Use

NONE

Not mounted

Module is registered but not linked

XLINK

Plastic SCM cross-repository link

Production — pinned to a specific changeset, read-only

SYMLINK

Filesystem symbolic link

Development — live editing of the linked repository

Mounting Process

When Mount() is called:

  1. If already mounted with a different state, the existing link is removed first

  2. For XLINK: resolves the target changeset and creates an xlink via the project workspace

  3. For SYMLINK: creates a filesystem symlink from the target path to the mount path

  4. Wraps the operation in AssetDatabase.StartAssetEditing/StopAssetEditing with progress bars

  5. Triggers AssetDatabase.Refresh() and EditorUtility.RequestScriptReload() on completion

Initialization

Initialize() resolves the Repository and Workspace from serialized names via the PlasticSCM static API.

Quick Lookup

Goal
How

Check if mounted

module.IsMounted

Get mount type

module.GetMountState()

Mount as xlink

module.Mount(MountState.XLINK)

Mount as symlink

module.Mount(MountState.SYMLINK)

Unmount

module.Mount(MountState.NONE)

Set mount path

module.SetMountPath("/Assets/Paragon/Core")

Set target path

module.SetTargetPath("/Core")

Get full mount path

module.GetFullMountPath()

Get target branch

module.GetTargetBranch()

Get target changeset

module.GetTargetChangeset()

Switch workspace

module.SwitchWorkspace(workspace)

Properties

Property
Type
Access
Description

Repository

Repository

public

The Plastic SCM repository this module references

Workspace

Workspace

public

The workspace within the repository (may be null)

Name

string

public

Module name (same as repository name)

MountPath

string

public

Path within the project where the module is mounted (e.g., /Assets/Paragon/Core)

TargetPath

string

public

Path within the module's workspace to link (e.g., /Core)

IsMounted

bool

public

true if mount state is XLINK or SYMLINK

Fields

Field
Type
Attribute
Description

repositoryName

string

[SerializeField]

Serialized repository name for persistence

workspaceName

string

[SerializeField]

Serialized workspace name for persistence

mountPath

string

[SerializeField]

Serialized mount path

targetPath

string

[SerializeField]

Serialized target path

Constructors

EngineModule(string)

Creates a module for the named repository with empty mount and target paths.

Methods

Initialize

Resolves the Repository and Workspace from serialized names via PlasticSCM.

Mount

Mounts or unmounts the module with the specified strategy. If already mounted differently, unmounts first.

Parameter
Type
Description

mountState

MountState

The desired mount state (NONE, XLINK, or SYMLINK)

GetMountState

Returns the current mount state by checking for xlinks and symlinks.

GetTargetChangeset / GetTargetBranch

Returns the changeset or branch the module is targeting. If mounted via xlink, reads from the xlink metadata; otherwise, reads the workspace's current state.

SetMountPath / SetTargetPath

Configures the mount and target paths.

GetFullMountPath / GetFullTargetPath

Returns absolute filesystem paths by combining with the project/workspace root.

SwitchWorkspace

Changes the workspace used by this module.

Returns the Plastic SCM xlink at the mount path, or null if none exists.

Common Pitfalls

circle-exclamation
circle-exclamation
circle-exclamation

See Also

Last updated