Version: 2021.1

LightBakingOutput

struct in UnityEngine

切换到手册

描述

结构,描述给定光源的全局光照烘焙结果。

下面的示例说明如何检查光源的烘焙状态和更改其活动状态。

using UnityEngine;
using System.Collections;

public class LightBakingOutputExample : MonoBehaviour { void TurnOffLight(Light light) { if (light.bakingOutput.isBaked && light.bakingOutput.lightmapBakeType != LightmapBakeType.Realtime) { Debug.Log("Light got some contribution statically baked, it cannot be turned off at runtime."); } else { light.enabled = false; } } }

变量

isBaked光贡献是否已存储在光照贴图和/或光照探针中?
lightmapBakeType此属性描述对光贡献的哪个部分进行了烘焙。
mixedLightingMode对于 LightmapBakeType.Mixed 光源,描述用于对光源进行烘焙的混合模式,否则不相关。
occlusionMaskChannel对于 LightmapBakeType.Mixed 光源,包含要使用的遮挡遮罩通道的索引(如果有),否则为 -1。
probeOcclusionLightIndex对于 LightmapBakeType.Mixed 光源,包含从遮挡探针视角看到的光源的索引(如果有),否则为 -1。