SceneGraphBuildProcessor

Internal build processor that injects the SceneGraph asset into builds as a preloaded asset, then restores the original preloaded assets list after the build completes.

Definition

Namespace: Paragon.Core.SceneManagement.Editor Assembly: Paragon.Editor.dll

internal class SceneGraphBuildProcessor : IPreprocessBuildWithReport, IPostprocessBuildWithReport

Implements: IPreprocessBuildWithReport, IPostprocessBuildWithReport

Remarks

The SceneGraph is normally stored in ProjectSettings/SceneGraph.asset (outside the Assets/ folder), which means it isn't included in builds by default. This processor handles the injection:

  1. Pre-build — Copies ProjectSettings/SceneGraph.asset to Assets/Build/Resources/SceneGraph.asset, imports it, and adds it to PlayerSettings.GetPreloadedAssets()

  2. Post-build — Restores the original preloaded assets list (removing the temporarily added entry)

The callback order is 1, ensuring it runs early in the build pipeline.

Properties

callbackOrder

int IOrderedCallback.callbackOrder => 1;

Build callback execution order. Runs early (1) to ensure the SceneGraph is available for other processors.

Methods

OnPreprocessBuild

Copies the SceneGraph from ProjectSettings/ into Assets/Build/Resources/, imports it, and adds it to the preloaded assets.

circle-info

Build failure on error: If the SceneGraph cannot be loaded or is already in the preloaded assets list, the build fails with a BuildFailedException.

OnPostprocessBuild

Restores the original preloaded assets list, removing the temporarily injected SceneGraph.

Common Pitfalls

circle-exclamation
circle-exclamation

See Also

Last updated