player can work now
This commit is contained in:
@@ -23,7 +23,7 @@ public class JobSelectorUI : MonoBehaviour
|
||||
[SerializeField]
|
||||
private JobsListSO _jobs;
|
||||
|
||||
public void ShowJobSelectionDialog(string title, string description, Action onCancel, Action<TimeSpan> onConfirm)
|
||||
public void ShowJobSelectionDialog(string title, string description, Action onCancel, Action onConfirm)
|
||||
{
|
||||
UIManager.Instance.Freeze();
|
||||
|
||||
@@ -42,10 +42,10 @@ public class JobSelectorUI : MonoBehaviour
|
||||
{
|
||||
onCancel?.Invoke();
|
||||
Hide();
|
||||
CloseDialog();
|
||||
});
|
||||
_btnOk.onClick.AddListener(() =>
|
||||
{
|
||||
onConfirm?.Invoke();
|
||||
Hide();
|
||||
});
|
||||
}
|
||||
@@ -58,6 +58,7 @@ public class JobSelectorUI : MonoBehaviour
|
||||
private void Hide()
|
||||
{
|
||||
gameObject.SetActive(false);
|
||||
CloseDialog();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ public class TimeSliderUI : MonoBehaviour
|
||||
[SerializeField]
|
||||
private Slider _slider;
|
||||
|
||||
private TimeSpan _time;
|
||||
public void ShowTimeSliderDialog(string title, string description, Action onCancel, Action<TimeSpan> onConfirm)
|
||||
{
|
||||
TimeManager.Instance.OnFastForwardEnd += CloseDialog;
|
||||
@@ -34,7 +35,7 @@ public class TimeSliderUI : MonoBehaviour
|
||||
});
|
||||
_btnOk.onClick.AddListener(() =>
|
||||
{
|
||||
onConfirm?.Invoke(TimeSpan.FromSeconds(_slider.value));
|
||||
onConfirm?.Invoke(_time);
|
||||
Hide();
|
||||
});
|
||||
|
||||
@@ -52,9 +53,9 @@ public class TimeSliderUI : MonoBehaviour
|
||||
|
||||
private void Update()
|
||||
{
|
||||
var time = TimeSpan.FromSeconds(_slider.value);
|
||||
_time = TimeSpan.FromHours(_slider.value);
|
||||
|
||||
_description.text = $"{time.Hours} hours {time.Minutes} minutes";
|
||||
_description.text = $"{_time.Hours} hours";
|
||||
}
|
||||
|
||||
private void Hide()
|
||||
|
||||
@@ -32,7 +32,7 @@ public class UIManager : MonoBehaviour
|
||||
timeSlider.ShowTimeSliderDialog(title, description, onCancel, onConfirm);
|
||||
}
|
||||
|
||||
public void ShowJobSelectionDialog(string title, string description, Action onCancel, Action<TimeSpan> onConfirm)
|
||||
public void ShowJobSelectionDialog(string title, string description, Action onCancel, Action onConfirm)
|
||||
{
|
||||
var jobSelector = Instantiate(_jobSelectorPrefab, transform);
|
||||
jobSelector.ShowJobSelectionDialog(title, description, onCancel, onConfirm);
|
||||
|
||||
Reference in New Issue
Block a user