49 lines
1.4 KiB
C#
Raw Normal View History

2025-09-08 14:51:28 +08:00
using UnityEditor;
using UnityEngine;
using UnityEngine.UI;
using ZXKFramework;
using System.Windows;
2025-09-08 17:37:12 +08:00
namespace DongWuYiXue.DaoNiaoShu
2025-09-08 14:51:28 +08:00
{
public class HomePanel : UIBase
{
Button homeBtn;
Button shutDown;
public override string GroupName => "HomePanel";
public override string Name => "HomePanel";
public override void Init(IUIManager uictrl)
{
base.Init(uictrl);
homeBtn = transform.FindFirst<Button>("BackBtn");
shutDown = transform.FindFirst<Button>("ShutDownBtn");
if(Game.Instance.platformType == PlatformType.WebGL)
{
shutDown.gameObject.SetActive(false);
}
if (homeBtn)
{
homeBtn.onClick.AddListener(() => {
Game.Instance.sound.StopBGM();
Game.Instance.IEnumeratorManager.StopAll();
UnityEngine.SceneManagement.SceneManager.LoadScene("Main");
});
}
if (shutDown)
{
shutDown.onClick.AddListener(() => {
#if UNITY_EDITOR //<2F>ڱ༭<DAB1><E0BCAD>ģʽ<C4A3><CABD>
EditorApplication.isPlaying = false;
#else
Application.Quit();
#endif
});
}
}
public override void Show()
{
base.Show();
}
}
}