try to fix tabs
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user