GenerateInBackground()
Starts baking static occlusion culling data for the loaded scenes in the background.
Read time 1 minuteLast updated 5 days ago
Definition
- Type: Method
- Namespace: UnityEditor
- Assembly: UnityEditor.CoreModule
public static bool GenerateInBackground()
Returns
Type | Description |
|---|---|
| bool | Returns |
Remarks
This method returns immediately. Use StaticOcclusionCulling.isRunning to check whether the bake is still running, and StaticOcclusionCulling.Cancel to stop it. When the bake finishes, Unity saves the result as an occlusion culling data asset and assigns it to the loaded scenes. Opening a scene, entering Play mode, or quitting the Editor cancels the bake.
If a static renderer or occlusion portal included in the bake is destroyed before the bake finishes, Unity discards the result and logs a warning. This happens, for example, when a build reloads the open scenes. If a script needs the occlusion data before it continues, for example in a build callback, use StaticOcclusionCulling.Compute instead.
Additional Resources: StaticOcclusionCulling.Compute, StaticOcclusionCulling.Cancel, StaticOcclusionCulling.isRunning.