58 lines
1.3 KiB
C#
58 lines
1.3 KiB
C#
using System;
|
|
using UnityEngine;
|
|
|
|
public class UIManager : MonoBehaviour
|
|
{
|
|
[SerializeField]
|
|
public TimeSliderUI _timeSliderPrefab;
|
|
[SerializeField]
|
|
public JobSelectorUI _jobSelectorPrefab;
|
|
[SerializeField]
|
|
public GameObject _blurOverlay;
|
|
|
|
public static UIManager Instance { get; private set; }
|
|
|
|
private void Awake()
|
|
{
|
|
if (Instance != null)
|
|
{
|
|
return;
|
|
}
|
|
Instance = this;
|
|
}
|
|
|
|
private void Start()
|
|
{
|
|
_blurOverlay.SetActive(false);
|
|
}
|
|
|
|
public void ShowTimeSliderDialog(string title, string description, Action onCancel, Action<TimeSpan> onConfirm)
|
|
{
|
|
var timeSlider = Instantiate(_timeSliderPrefab, transform);
|
|
timeSlider.ShowTimeSliderDialog(title, description, onCancel, onConfirm);
|
|
}
|
|
|
|
public void ShowJobSelectionDialog(string title, string description, Action onCancel, Action onConfirm)
|
|
{
|
|
var jobSelector = Instantiate(_jobSelectorPrefab, transform);
|
|
jobSelector.ShowJobSelectionDialog(title, description, onCancel, onConfirm);
|
|
}
|
|
|
|
|
|
|
|
public void Freeze()
|
|
{
|
|
_blurOverlay.SetActive(true);
|
|
}
|
|
|
|
public void Unfreeze()
|
|
{
|
|
_blurOverlay.SetActive(false);
|
|
}
|
|
|
|
private void OnDisable()
|
|
{
|
|
}
|
|
|
|
}
|