浏览代码

Convert tabs to spaces

/1.5-preview
Tim Mowrer 6 年前
当前提交
19e98972
共有 1 个文件被更改,包括 35 次插入35 次删除
  1. 70
      Assets/Scripts/LightEstimation.cs

70
Assets/Scripts/LightEstimation.cs


[RequireComponent(typeof(Light))]
public class LightEstimation : MonoBehaviour
{
Light m_Light;
Light m_Light;
public float? brightness { get; private set; }
public float? brightness { get; private set; }
public float? colorTemperature { get; private set; }
public float? colorTemperature { get; private set; }
public Color? colorCorrection { get; private set; }
public Color? colorCorrection { get; private set; }
void Awake ()
{
m_Light = GetComponent<Light>();
}
void Awake ()
{
m_Light = GetComponent<Light>();
}
void OnEnable()
{
ARSubsystemManager.cameraFrameReceived += FrameChanged;
}
void OnEnable()
{
ARSubsystemManager.cameraFrameReceived += FrameChanged;
}
void OnDisable()
{
ARSubsystemManager.cameraFrameReceived -= FrameChanged;
}
void OnDisable()
{
ARSubsystemManager.cameraFrameReceived -= FrameChanged;
}
void FrameChanged(ARCameraFrameEventArgs args)
{
if (args.lightEstimation.averageBrightness.HasValue)
{
brightness = args.lightEstimation.averageBrightness.Value;
m_Light.intensity = brightness.Value;
}
void FrameChanged(ARCameraFrameEventArgs args)
{
if (args.lightEstimation.averageBrightness.HasValue)
{
brightness = args.lightEstimation.averageBrightness.Value;
m_Light.intensity = brightness.Value;
}
if (args.lightEstimation.averageColorTemperature.HasValue)
{
colorTemperature = args.lightEstimation.averageColorTemperature.Value;
m_Light.colorTemperature = colorTemperature.Value;
}
if (args.lightEstimation.colorCorrection.HasValue)
{
colorCorrection = args.lightEstimation.colorCorrection.Value;
m_Light.color = colorCorrection.Value;
}
}
if (args.lightEstimation.averageColorTemperature.HasValue)
{
colorTemperature = args.lightEstimation.averageColorTemperature.Value;
m_Light.colorTemperature = colorTemperature.Value;
}
if (args.lightEstimation.colorCorrection.HasValue)
{
colorCorrection = args.lightEstimation.colorCorrection.Value;
m_Light.color = colorCorrection.Value;
}
}
}

正在加载...
取消
保存