60 lines
1.4 KiB
C#
60 lines
1.4 KiB
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
namespace AibisDream
|
|
{
|
|
public class MainPanel : MonoBehaviour, IUIPanel
|
|
{
|
|
public bool IsOpen => gameObject.activeSelf;
|
|
|
|
#region 面板控制
|
|
|
|
public void Show()
|
|
{
|
|
gameObject.SetActive(true);
|
|
}
|
|
|
|
public void Hide()
|
|
{
|
|
gameObject.SetActive(false);
|
|
}
|
|
|
|
#endregion
|
|
|
|
private void Awake()
|
|
{
|
|
RegisterButton();
|
|
}
|
|
|
|
private void RegisterButton()
|
|
{
|
|
// 为按钮注册事件
|
|
var topBar = transform.Find("Top Bar");
|
|
topBar.Find("Setting").GetComponent<Button>().onClick.AddListener(OpenSettingPanel);
|
|
topBar.Find("Record").GetComponent<Button>().onClick.AddListener(OpenRecordPanel);
|
|
topBar.Find("Auto Skip").GetComponent<Button>().onClick.AddListener(AutoSkip);
|
|
topBar.Find("Quick Forward").GetComponent<Button>().onClick.AddListener(QuickForward);
|
|
}
|
|
|
|
private void AutoSkip()
|
|
{
|
|
|
|
}
|
|
|
|
private void QuickForward()
|
|
{
|
|
|
|
}
|
|
|
|
private void OpenSettingPanel()
|
|
{
|
|
UIManager.Instance.ShowPanel<SettingPanel>();
|
|
}
|
|
|
|
private void OpenRecordPanel()
|
|
{
|
|
UIManager.Instance.ShowPanel<RecordPanel>();
|
|
}
|
|
}
|
|
}
|