38 lines
1.1 KiB
C#
38 lines
1.1 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using ZXKFramework;
|
|
using System.Windows;
|
|
using UnityEditor;
|
|
namespace YiLiao.Main
|
|
{
|
|
public class HomePanel : UIBase
|
|
{
|
|
Button shutBtn;
|
|
Button homeBtn;
|
|
public override string GroupName => "HomePanel";
|
|
public override string Name => "HomePanel";
|
|
public override void Init(IUIManager uictrl)
|
|
{
|
|
base.Init(uictrl);
|
|
shutBtn = transform.FindFirst<Button>("ShutBtn");
|
|
if (Game.Instance.platformType == PlatformType.WebGL)
|
|
{
|
|
shutBtn.gameObject.SetActive(false);
|
|
}
|
|
homeBtn = transform.FindFirst<Button>("HomeBtn");
|
|
shutBtn.onClick.AddListener(() => {
|
|
#if UNITY_EDITOR //ÔÚ±à¼Æ÷ģʽÏÂ
|
|
EditorApplication.isPlaying = false;
|
|
#else
|
|
Application.Quit();
|
|
#endif
|
|
});
|
|
homeBtn.onClick.AddListener(() =>
|
|
{
|
|
Game.Instance.fsm.ChangeState<GameProjectState>();
|
|
});
|
|
}
|
|
}
|
|
} |