浏览代码

cleaned up naming convetions and added autoprops

/1.5-preview
Dan 6 年前
当前提交
ae28315b
共有 2 个文件被更改,包括 12 次插入28 次删除
  1. 33
      Assets/Scripts/LightEstimation.cs
  2. 7
      Assets/Scripts/LightEstimationUI.cs

33
Assets/Scripts/LightEstimation.cs


{
Light m_Light;
float? m_Brightness;
public float? brightness { get; private set; }
public float? Brightness
{
get { return m_Brightness; }
}
public float? colorTemperature { get; private set; }
float? m_ColorTemperature;
public float? ColorTemperature
{
get { return m_ColorTemperature; }
}
Color? m_ColorCorrection;
public Color? ColorCorrection
{
get { return m_ColorCorrection; }
}
public Color? colorCorrection { get; private set; }
void Awake ()
{

{
if (args.lightEstimation.averageBrightness.HasValue)
{
m_Brightness = args.lightEstimation.averageBrightness.Value;
m_Light.intensity = m_Brightness.Value;
brightness = args.lightEstimation.averageBrightness.Value;
m_Light.intensity = brightness.Value;
m_ColorTemperature = args.lightEstimation.averageColorTemperature.Value;
m_Light.colorTemperature = m_ColorTemperature.Value;
colorTemperature = args.lightEstimation.averageColorTemperature.Value;
m_Light.colorTemperature = colorTemperature.Value;
m_ColorCorrection = args.lightEstimation.colorCorrection.Value;
m_Light.color = m_ColorCorrection.Value;
colorCorrection = args.lightEstimation.colorCorrection.Value;
m_Light.color = colorCorrection.Value;
}
}
}

7
Assets/Scripts/LightEstimationUI.cs


void Update()
{
SetUIValue(m_LightEstimation.Brightness.HasValue, m_BrightnessVal, m_LightEstimation.Brightness.Value.ToString());
SetUIValue(m_LightEstimation.ColorTemperature.HasValue, m_ColorTempVal, m_LightEstimation.ColorTemperature.Value.ToString());
SetUIValue(m_LightEstimation.ColorCorrection.HasValue, m_ColorCorrectVal, m_LightEstimation.ColorTemperature.Value.ToString());
SetUIValue(m_LightEstimation.brightness.HasValue, m_BrightnessVal, m_LightEstimation.brightness.Value.ToString());
SetUIValue(m_LightEstimation.colorTemperature.HasValue, m_ColorTempVal, m_LightEstimation.colorTemperature.Value.ToString());
SetUIValue(m_LightEstimation.colorCorrection.HasValue, m_ColorCorrectVal, m_LightEstimation.colorTemperature.Value.ToString());
}
void SetUIValue(bool ContainsValue, Text UIText, string DisplayValue)

正在加载...
取消
保存