using UnityEngine;
using UnityEngine.UI;

public sealed class MessageUIPanel : MonoBehaviour
{
    [SerializeField]
    private Text titleLabel = null;
    [SerializeField]
    private Text messageLabel = null;

    public void Show(string message, string title = null)
    {
        gameObject.SetActive(true);
        messageLabel.text = message ?? string.Empty;
        titleLabel.text = title ?? string.Empty;
        titleLabel.gameObject.SetActive(!string.IsNullOrEmpty(title));
    }

    public void Hide()
    {
        gameObject.SetActive(false);
    }
}
