2using System.Collections;
3using System.Collections.Generic;
10 [SerializeField]
private Text titleUi;
11 [SerializeField]
private Text textUi;
12 [SerializeField]
private Button yesButton;
13 [SerializeField]
private Button noButton;
14 [SerializeField]
private GameObject popupWindow;
15 [SerializeField]
private CanvasGroup cg;
21 titleUi.text =
Macro.
T(title);
22 textUi.text =
Macro.
T(text);
23 yesButton.GetComponentInChildren<Text>().text =
Macro.
T(
"YES");
24 noButton.GetComponentInChildren<Text>().text =
Macro.
T(
"NO");
28 cg.blocksRaycasts =
true;
29 cg.interactable =
true;
30 noButton.onClick.AddListener(invokerNo);
32 popupWindow.SetActive(
true);
36 public void ShowPopup(
string title,
string text,
string yes,
string no)
38 titleUi.text =
Macro.
T(title);
39 textUi.text =
Macro.
T(text);
40 yesButton.GetComponentInChildren<Text>().text =
Macro.
T(yes);
41 noButton.GetComponentInChildren<Text>().text =
Macro.
T(no);
45 cg.blocksRaycasts =
true;
46 cg.interactable =
true;
47 noButton.onClick.AddListener(invokerNo);
49 popupWindow.SetActive(
true);
58 cg.blocksRaycasts =
false;
59 cg.interactable =
false;
61 popupWindow.SetActive(
false);
67 yesButton.onClick.AddListener(invokerYes);
70 private void invokerYes()
73 yesButton.onClick.RemoveListener(invokerYes);
82 noButton.onClick.AddListener(invokerNo);
85 private void invokerNo()
88 noButton.onClick.RemoveListener(invokerNo);
UnityEngine.UI.Button Button
static string T(string key)