using UnityEngine;
using UnityEngine.UI;

namespace Mono
{
    [UIBinding(prefab = "MainScenePanel")]
    public class MainScenePanel : UIPanel
    {
        public Button Btn_Home;
        public Button Btn_Visit;
        public Button Btn_My;
        public Button Btn_CSG;

        public override void GetUIData()
        {
            Btn_Home = UIData.Get<Button>("Btn_Home");
            Btn_Visit = UIData.Get<Button>("Btn_Visit");
            Btn_My = UIData.Get<Button>("Btn_My");
            Btn_CSG = UIData.Get<Button>("Btn_CSG");
        }

        public override void AddButtonEvent()
        {
            Btn_Home.onClick.AddListener(() => { Debug.Log("点击家园"); });
            Btn_Visit.onClick.AddListener(() => { Debug.Log("点击游览"); });
            Btn_My.onClick.AddListener(() => { Debug.Log("点击我的"); });
            Btn_CSG.onClick.AddListener(() =>
            {
                UIManager.Instance.HideUIPanel<MainScenePanel>();
                UIManager.Instance.LoadAndOpenPanel<CSGPanel>(UIManager.UILayer.Middle);
            });
        }
    }
}