Files
aibis-dream/Assets/Scripts/UI/Panel/EndPanel.cs
T

56 lines
1.3 KiB
C#

using UnityEngine;
using UnityEngine.UI;
namespace AibisDream.UI
{
public class EndPanel : MonoBehaviour, IUIPanel
{
public bool IsOpen => gameObject.activeSelf;
public bool IsCloseable => false;
#region 打开和关闭
public void Show()
{
gameObject.SetActive(true);
RegisterButton();
}
public void Hide()
{
gameObject.SetActive(false);
UnRegisterButton();
}
#endregion
private void RegisterButton()
{
var returnBtn = transform.Find("返回").GetComponent<Button>();
returnBtn.onClick.AddListener(BackToMain);
}
private void UnRegisterButton()
{
var returnBtn = transform.Find("返回").GetComponent<Button>();
returnBtn.onClick.RemoveAllListeners();
}
private void BackToMain()
{
UIManager.Instance.HidePanel<EndPanel>();
GameManager.Instance.TryReturnToMainMenu();
}
// private void OpenFeedbackLink()
// {
// Application.OpenURL(ConstRef.SurveyURL);
// }
// private void OpenBugLink()
// {
// Application.OpenURL(ConstRef.BugSurveyURL);
// }
}
}