using UnityEngine;
public class EmailPopupManager : MonoBehaviour
{
public static EmailPopupManager Instance;
[Header("Alert Popup Reference")]
public GameObject hackedAlertImage; // 🔴 Assign in Inspector
private void Awake()
{
if (Instance != null && Instance != this)
{
Destroy(gameObject);
return;
}
Instance = this;
if (hackedAlertImage != null)
hackedAlertImage.SetActive(false); // Hide on start
}
///
/// Call this to show the hacked alert popup.
///
/// Optional: the link clicked
public void ShowPopup(string linkID)
{
Debug.Log($"🔐 Showing popup due to link: {linkID}");
if (hackedAlertImage != null)
{
hackedAlertImage.SetActive(true);
hackedAlertImage.transform.SetAsLastSibling();
}
// Optional: You could log/report/phish-specific response here
// e.g., start a fake login simulation, trigger scene event, etc.
}
public void HidePopup()
{
if (hackedAlertImage != null)
hackedAlertImage.SetActive(false);
}
}