49 lines
1.4 KiB
C#
49 lines
1.4 KiB
C#
using UnityEditor;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using ZXKFramework;
|
|
using System.Windows;
|
|
namespace DongWuYiXue.DaoNiaoShu
|
|
{
|
|
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 //ÔÚ±à¼Æ÷ģʽÏÂ
|
|
EditorApplication.isPlaying = false;
|
|
#else
|
|
Application.Quit();
|
|
#endif
|
|
});
|
|
}
|
|
}
|
|
public override void Show()
|
|
{
|
|
base.Show();
|
|
}
|
|
|
|
}
|
|
}
|