25 lines
567 B
C#
25 lines
567 B
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class DurationSlider : MonoBehaviour
|
|
{
|
|
public Text text;
|
|
|
|
public Slider slider;
|
|
|
|
private void OnEnable()
|
|
{
|
|
UpdateValue();
|
|
}
|
|
|
|
public void UpdateValue()
|
|
{
|
|
if ((bool)GlobalSettings.Instance)
|
|
{
|
|
GlobalSettings.Instance.tournamentDefinition.duration = (int)slider.value;
|
|
}
|
|
text.text = Utilities.GetTranslation("GUI/TOURNAMENTS_DURATION") + ": " + slider.value + " min";
|
|
text.color = new Color(text.color.r, text.color.g, text.color.b, (!slider.interactable) ? slider.colors.disabledColor.a : 1f);
|
|
}
|
|
}
|