using System; using System.Collections; using System.Collections.Generic; using TMPro; using UnityEngine; public class NotificationPopupUI : MonoBehaviour { private TextMeshProUGUI _title; private TextMeshProUGUI _description; private Animator _animator; private void Awake() { _title = transform.Find("Title").GetComponent(); _description = transform.Find("Description").GetComponent(); _animator = GetComponent(); transform.gameObject.SetActive(true); transform.GetComponent().alpha = 0; } public IEnumerator Show(string title, string content) { if (!transform.gameObject.activeSelf) transform.gameObject.SetActive(true); transform.GetComponent().alpha = 0; _title.text = title; _description.text = content; _animator.Play("In"); yield return new WaitForSeconds(3f); _animator.Play("Out"); } }