little refactor

This commit is contained in:
Vladimir Koshevarov
2023-03-15 15:34:32 +02:00
parent 68a14fd9ec
commit f12a92deac
14 changed files with 2136 additions and 2024 deletions
+47
View File
@@ -0,0 +1,47 @@
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()
{
}
}