文档

Unity Engine

Unity Engine

Compute()

Bakes static occlusion culling data for the loaded scenes and waits until the bake finishes.
阅读时间1 分钟最后更新于 6 天前

Definition

  • Type: Method
  • Namespace: UnityEditor
  • Assembly: UnityEditor.CoreModule
警告
Deprecated. StaticOcclusionCulling is deprecated and will be removed in a future release. Consider migrating to GPU Occlusion Culling where your target platform supports it. #from(6000.7)
public static bool Compute()

Returns

Type

Description

boolReturns
true
if the bake completes and the occlusion data is applied to the loaded scenes. Returns
false
if the bake fails, for example if the loaded scenes contain no static renderers or static terrains.

Remarks

This method blocks the Editor until the bake finishes. If a bake started with StaticOcclusionCulling.GenerateInBackground is running, this method cancels it first.
Use this method when a script needs the occlusion data before it continues, for example in a build callback such as IPreprocessBuildWithReport.OnPreprocessBuild. The bake marks the affected scenes as modified, so save them afterwards to include the new data in the build.