summaryrefslogtreecommitdiff
path: root/GameCode/ErrorHandler.cs
blob: e9ffc173aedf5e8b41332afb3f47961d83438626 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using TMPro;
using UnityEngine;

public class ErrorHandler : MonoBehaviour
{
	public static ErrorHandler instance;

	public TextMeshProUGUI contextText;

	public TextMeshProUGUI reasonText;

	public GameObject UI;

	private void Awake()
	{
		instance = this;
	}

	public void ShowError(string context, string reason)
	{
		contextText.text = context;
		reasonText.text = reason;
		UI.SetActive(value: true);
	}

	public void HideError()
	{
		UI.SetActive(value: false);
	}
}