62 lines
1.9 KiB
C#
62 lines
1.9 KiB
C#
using AibisDream.Utility;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
namespace AibisDream.UI
|
|
{
|
|
public class EndPanel : MonoBehaviour, IUIPanel
|
|
{
|
|
[SerializeField] private Button surveyButton;
|
|
[SerializeField] private Button wishlistButton;
|
|
[SerializeField] private Button communityButton;
|
|
[SerializeField] private Button contactButton;
|
|
|
|
public bool IsOpen => gameObject.activeSelf;
|
|
public bool IsCloseable => false;
|
|
|
|
private void Awake()
|
|
{
|
|
RegisterButtons();
|
|
}
|
|
|
|
private void OnDestroy()
|
|
{
|
|
UnregisterButtons();
|
|
}
|
|
|
|
public void Show()
|
|
{
|
|
gameObject.SetActive(true);
|
|
}
|
|
|
|
public void Hide()
|
|
{
|
|
gameObject.SetActive(false);
|
|
}
|
|
|
|
private void RegisterButtons()
|
|
{
|
|
if (surveyButton != null)
|
|
surveyButton.onClick.AddListener(PlaytestLinkUtility.OpenSurvey);
|
|
if (wishlistButton != null)
|
|
wishlistButton.onClick.AddListener(PlaytestLinkUtility.OpenWishlist);
|
|
if (communityButton != null)
|
|
communityButton.onClick.AddListener(PlaytestLinkUtility.OpenCommunity);
|
|
if (contactButton != null)
|
|
contactButton.onClick.AddListener(PlaytestLinkUtility.OpenContact);
|
|
}
|
|
|
|
private void UnregisterButtons()
|
|
{
|
|
if (surveyButton != null)
|
|
surveyButton.onClick.RemoveListener(PlaytestLinkUtility.OpenSurvey);
|
|
if (wishlistButton != null)
|
|
wishlistButton.onClick.RemoveListener(PlaytestLinkUtility.OpenWishlist);
|
|
if (communityButton != null)
|
|
communityButton.onClick.RemoveListener(PlaytestLinkUtility.OpenCommunity);
|
|
if (contactButton != null)
|
|
contactButton.onClick.RemoveListener(PlaytestLinkUtility.OpenContact);
|
|
}
|
|
}
|
|
}
|