48 lines
945 B
C#
48 lines
945 B
C#
using System;
|
|
using UnityEngine;
|
|
|
|
public class UIManager : MonoBehaviour
|
|
{
|
|
[SerializeField]
|
|
public TimeSliderUI _timeSliderPrefab;
|
|
[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 Freeze()
|
|
{
|
|
_blurOverlay.SetActive(true);
|
|
}
|
|
|
|
public void Unfreeze()
|
|
{
|
|
_blurOverlay.SetActive(false);
|
|
}
|
|
|
|
private void OnDisable()
|
|
{
|
|
}
|
|
|
|
}
|