SceneImportContext
Additional import context for scene assets used in AssetPostprocessor.OnProcessScene(Scene, SceneImportContext).
Read time 1 minuteLast updated 10 days ago
Definition
- Type: Struct
- Namespace: UnityEditor.Build.Content
- Assembly: UnityEditor.CoreModule
public struct SceneImportContext
Remarks
Unity passes an instance of this struct to AssetPostprocessor.OnProcessScene(Scene, SceneImportContext) for every scene it processes during a Player build or in Play mode.
Additional Resources: AssetPostprocessor.OnProcessScene(Scene, SceneImportContext), ProcessSceneMode
The following example logs a message when a scene is processed while Awake has been called before the callback.
Examples
using UnityEditor;using UnityEditor.Build.Content;using UnityEngine;using UnityEngine.SceneManagement;class MySceneProcessor : AssetPostprocessor{ public void OnProcessScene(Scene scene, SceneImportContext sceneContext) { if (sceneContext.awakeDidRun) Debug.Log($"Processing {scene.name} with Awake already called."); }}
Properties
Property | Description |
|---|---|
| awakeDidRun | Indicates whether Unity has already called Awake on the objects in the scene. |
| loadingReason | Indicates the reason for which the scene is being loaded. |