浏览代码

reset all light estimation properties when unavailable

/4.1
Shan Jiang 4 年前
当前提交
44400d20
共有 4 个文件被更改,包括 26 次插入4 次删除
  1. 1
      Assets/Scenes/LightEstimation/BasicLightEstimation.unity
  2. 12
      Assets/Scripts/BasicLightEstimation.cs
  3. 4
      Assets/Scripts/BasicLightEstimationUI.cs
  4. 13
      Assets/Scripts/HDRLightEstimation.cs

1
Assets/Scenes/LightEstimation/BasicLightEstimation.unity


m_Name:
m_EditorClassIdentifier:
m_CameraManager: {fileID: 282840817}
m_Arrow: {fileID: 0}
--- !u!114 &1015722069
MonoBehaviour:
m_ObjectHideFlags: 0

12
Assets/Scripts/BasicLightEstimation.cs


brightness = args.lightEstimation.averageBrightness.Value;
m_Light.intensity = brightness.Value;
}
else
{
brightness = null;
}
if (args.lightEstimation.averageColorTemperature.HasValue)
{

else
{
colorTemperature = null;
}
}
else
{
colorCorrection = null;
}
}

4
Assets/Scripts/BasicLightEstimationUI.cs


void SetUIValue<T>(T? displayValue, Text text) where T : struct
{
if (text != null)
text.text = displayValue.HasValue ? displayValue.Value.ToString(): k_UnavailableText;
text.text = displayValue.HasValue ? displayValue.Value.ToString(): "Unavailable";
const string k_UnavailableText = "Unavailable";
BasicLightEstimation m_LightEstimation;
}

13
Assets/Scripts/HDRLightEstimation.cs


else
{
arrow?.gameObject.SetActive(false);
mainLightDirection = null;
}
if (args.lightEstimation.mainLightColor.HasValue)

}
else
{
mainLightColor = null;
}
if (args.lightEstimation.mainLightIntensityLumens.HasValue)
{

else
{
mainLightIntensityLumens = null;
}
if (args.lightEstimation.ambientSphericalHarmonics.HasValue)
{

}
else
{
sphericalHarmonics = null;
}
}

正在加载...
取消
保存