merge projects and arrange script folders

This commit is contained in:
voffka81
2022-08-17 11:14:32 +03:00
parent beea2145cb
commit c0ea0addcb
35 changed files with 608 additions and 0 deletions
+48
View File
@@ -0,0 +1,48 @@
using System;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
public class QuestionDialogUI : MonoBehaviour
{
//public static QuestionDialogUI Instance { get; private set; }
[SerializeField]
private TextMeshProUGUI _textMeshPro;
[SerializeField]
private Button _yesBtn;
[SerializeField]
private Button _noBtn;
private void Awake()
{
// Instance = this;
ShowQuestion("Are you sure ?", () =>
{
Debug.Log("Yes");
}, () =>
{
Debug.Log("No");
});
}
public void ShowQuestion(string questionText, Action yesAction, Action noAction)
{
_textMeshPro.text = questionText;
_yesBtn.onClick.AddListener(() =>
{
Hide();
yesAction();
});
_noBtn.onClick.AddListener(() =>
{
Hide();
noAction();
});
}
private void Hide()
{
gameObject.SetActive(false);
}
}