CapersProject/Assets/02.Scripts/Ui/PopupUi.cs

25 lines
615 B
C#
Raw Normal View History

2024-06-03 18:26:03 +00:00
using UnityEngine;
namespace BlueWater.Uis
{
public class PopupUi : MonoBehaviour
{
2024-10-29 06:45:18 +00:00
public bool IsOpened { get; protected set; }
2024-06-03 18:26:03 +00:00
2024-10-29 06:45:18 +00:00
public virtual void Open()
2024-06-03 18:26:03 +00:00
{
// 화면의 가장 앞으로 가져오기
transform.SetAsLastSibling();
gameObject.SetActive(true);
2024-10-29 06:45:18 +00:00
PopupUiController.RegisterPopup(this);
IsOpened = true;
2024-06-03 18:26:03 +00:00
}
public virtual void Close()
{
gameObject.SetActive(false);
2024-10-29 06:45:18 +00:00
PopupUiController.UnregisterPopup(this);
IsOpened = false;
2024-06-03 18:26:03 +00:00
}
}
}