2025-06-26 00:49:25 +05:00

47 lines
1.2 KiB
C#

using UnityEngine;
public class EmailPopupManager : MonoBehaviour
{
public static EmailPopupManager Instance;
[Header("Alert Popup Reference")]
public GameObject hackedAlertImage; // 🔴 Assign in Inspector
public bool emailScannedBool = false;
private void Awake()
{
if (Instance != null && Instance != this)
{
Destroy(gameObject);
return;
}
Instance = this;
if (hackedAlertImage != null)
hackedAlertImage.SetActive(false); // Hide on start
}
/// <summary>
/// Call this to show the hacked alert popup.
/// </summary>
/// <param name="linkID">Optional: the link clicked</param>
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);
}
}