Light.layerShadowCullDistances不会清除我的阴影;
如何复制:
附上下面的脚本:
公共类CullShadows:MonoBehaviour { 私人布尔EveryFrame; 公众浮动距离;
private void OnEnable() { if (everyFrame) return; SetShadowCullingDistances(); }
private void Update() { if (!everyFrame) return; SetShadowCullingDistances(); }
private void SetShadowCullingDistances()
{
var layers = new float[32];
for (int i = 0; i < 32; i++) { layers[i] = 1f; }
GetComponent<Light>().layerShadowCullDistances = layers;
}
}
按播放;至少总会有1个阴影投射器;