try to fix tabs

This commit is contained in:
2023-04-13 23:48:17 +03:00
parent 1f4659c3c0
commit 38cd7752d6
5 changed files with 18 additions and 257 deletions
+4 -11
View File
@@ -18,15 +18,9 @@ public class TimeSliderUI : MonoBehaviour
private TimeSpan _time;
private void Start()
{
gameObject.SetActive(false);
}
public void ShowTimeSliderDialog(string title, string description, Action onCancel, Action<TimeSpan> onConfirm)
{
TimeManager.Instance.OnFastForwardEnd += CloseDialog;
TimeManager.Instance.OnMinuteChanged += UpdateTime;
TimeManager.Instance.Pause();
UIManager.Instance.Freeze();
@@ -45,11 +39,9 @@ public class TimeSliderUI : MonoBehaviour
Hide();
});
_slider.onValueChanged.AddListener(x=>SliderValueChanger(x));
}
private void UpdateTime()
{
}
private void CloseDialog()
{
@@ -57,17 +49,18 @@ public class TimeSliderUI : MonoBehaviour
Destroy(this);
}
private void Update()
private void SliderValueChanger(float time)
{
if (gameObject.activeSelf)
{
_time = TimeSpan.FromHours(_slider.value);
_time = TimeSpan.FromHours(time);
_description.text = $"{_time.Hours} hours";
}
}
private void Hide()
{
_slider.onValueChanged.RemoveListener(x=>SliderValueChanger(x));
gameObject.SetActive(false);
TimeManager.Instance.Resume();
}