49 lines
845 B
C#
49 lines
845 B
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class BTN_OptionsFloatSize : MonoBehaviour
|
|
{
|
|
private Slider slider;
|
|
|
|
public Text text;
|
|
|
|
private PlayerSettingsMy playerSettings;
|
|
|
|
private void Start()
|
|
{
|
|
}
|
|
|
|
private void OnEnable()
|
|
{
|
|
Refresh();
|
|
}
|
|
|
|
public void Refresh()
|
|
{
|
|
if ((bool)GlobalSettings.Instance)
|
|
{
|
|
playerSettings = GlobalSettings.Instance.playerSettings;
|
|
}
|
|
slider = GetComponent<Slider>();
|
|
if ((bool)playerSettings)
|
|
{
|
|
slider.value = playerSettings.floatSizeMultiplier;
|
|
}
|
|
UpdateValue();
|
|
}
|
|
|
|
public void UpdateValue()
|
|
{
|
|
if ((bool)playerSettings)
|
|
{
|
|
playerSettings.SetFloatSizeMultiplier(slider.value);
|
|
}
|
|
LanguageChanged();
|
|
}
|
|
|
|
public void LanguageChanged()
|
|
{
|
|
text.text = Utilities.GetTranslation("GUI/OPTIONS_FLOAT_SIZE") + ": " + Mathf.RoundToInt(100f + slider.value * 25f) + " %";
|
|
}
|
|
}
|