# ProcessSceneMode

> Indicates the reason Unity is loading a scene: as part of a Player build, or when the Editor is in Play mode.

## Definition

* **Type:** Enum
* **Namespace:** [UnityEditor.Build.Content](/engine/6000.7/script-reference/unityeditor/build/content.md)
* **Assembly:** UnityEditor.CoreModule

```csharp
public enum ProcessSceneMode
```

## Remarks

Unity passes this value in [\_loadingReason](/engine/6000.7/script-reference/unityeditor/build/content/sceneimportcontext/loadingreason.md), which [AssetPostprocessor.OnProcessScene(Scene, SceneImportContext)](/engine/6000.7/script-reference/unityeditor/assetpostprocessor/onprocessscene.md) receives for every scene it processes.

Additional Resources: [SceneImportContext](/engine/6000.7/script-reference/unityeditor/build/content/sceneimportcontext.md), [AssetPostprocessor.OnProcessScene(Scene, SceneImportContext)](/engine/6000.7/script-reference/unityeditor/assetpostprocessor/onprocessscene.md)

The following example only processes scenes that are part of a Player build.

## Examples

```csharp
using UnityEditor;
using UnityEditor.Build.Content;
using UnityEngine;
using UnityEngine.SceneManagement;

class MySceneProcessor : AssetPostprocessor
{
    public void OnProcessScene(Scene scene, SceneImportContext sceneContext)
    {
        if (sceneContext.loadingReason == ProcessSceneMode.PlayerBuild)
            Debug.Log($"Processing {scene.name} for a Player build.");
    }
}
```

## Fields

| Value                                                                                                    | Description                                                 |
| -------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------- |
| [PlayerBuild](/engine/6000.7/script-reference/unityeditor/build/content/processscenemode/playerbuild.md) | The scene is being loaded as part of a Player build.        |
| [PlayMode](/engine/6000.7/script-reference/unityeditor/build/content/processscenemode/playmode.md)       | The scene is being loaded while the Editor is in Play mode. |
