30 lines
644 B
C#
30 lines
644 B
C#
using I2.Loc;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class PressureSlider : MonoBehaviour
|
|
{
|
|
public Text text;
|
|
|
|
private Slider slider;
|
|
|
|
private void OnEnable()
|
|
{
|
|
slider = GetComponent<Slider>();
|
|
UpdateValue();
|
|
}
|
|
|
|
public void UpdateValue()
|
|
{
|
|
if ((bool)GlobalSettings.Instance)
|
|
{
|
|
GlobalSettings.Instance.weatherSettings.pressure = slider.value;
|
|
}
|
|
if ((bool)text)
|
|
{
|
|
text.text = LocalizationManager.GetTermTranslation("GUI/WEATHER_PRESSURE") + ": " + slider.value + " hPa";
|
|
}
|
|
text.color = new Color(text.color.r, text.color.g, text.color.b, (!slider.interactable) ? slider.colors.disabledColor.a : 1f);
|
|
}
|
|
}
|