浏览代码

Convert tabs to spaces

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

70
Assets/Scripts/LightEstimationUI.cs


[RequireComponent(typeof(LightEstimation))]
public class LightEstimationUI : MonoBehaviour
{
[SerializeField]
Text m_BrightnessVal;
[SerializeField]
Text m_ColorTempVal;
[SerializeField]
Text m_ColorCorrectVal;
[SerializeField]
Text m_BrightnessVal;
[SerializeField]
Text m_ColorTempVal;
[SerializeField]
Text m_ColorCorrectVal;
LightEstimation m_LightEstimation;
LightEstimation m_LightEstimation;
const string k_UnavailableText = "Unavailable";
const string k_UnavailableText = "Unavailable";
void Awake()
{
m_LightEstimation = GetComponent<LightEstimation>();
}
void Awake()
{
m_LightEstimation = GetComponent<LightEstimation>();
}
void Update()
{
SetUIValue(m_LightEstimation.brightness, m_BrightnessVal);
SetUIValue(m_LightEstimation.colorTemperature, m_ColorTempVal);
SetUIValue(m_LightEstimation.colorCorrection, m_ColorCorrectVal);
}
void Update()
{
SetUIValue(m_LightEstimation.brightness, m_BrightnessVal);
SetUIValue(m_LightEstimation.colorTemperature, m_ColorTempVal);
SetUIValue(m_LightEstimation.colorCorrection, m_ColorCorrectVal);
}
void SetUIValue<T>(T? displayVar, Text uiText) where T : struct
{
if (uiText)
{
if (displayVar.HasValue)
{
uiText.text = displayVar.Value.ToString();
}
else
{
uiText.text = k_UnavailableText;
}
}
}
void SetUIValue<T>(T? displayVar, Text uiText) where T : struct
{
if (uiText)
{
if (displayVar.HasValue)
{
uiText.text = displayVar.Value.ToString();
}
else
{
uiText.text = k_UnavailableText;
}
}
}
}
正在加载...
取消
保存