little refactor
This commit is contained in:
@@ -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()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user