// 本脚本只在不存在时会生成一次。组件逻辑写在当前脚本内。已存在不会再次生成覆盖 

using UnityEngine;
using FairyGUI;
using NBC;

namespace NBF
{
    public partial class HomeButtonGroups : GComponent
    {
        private void OnInited()
        {
            this.AutoAddClick(OnClick);
        }

        private void OnClick(GComponent btn)
        {
            if (btn == BtnExit)
            {
                MessageBox.Show("确定退出吗？", (b) =>
                {
                    if (b) Application.Quit();
                });
            }
            else if (btn == BtnSettings)
            {
                SettingPanel.Show();
            }
            else if (btn == BtnBag)
            {
                BagPanel.Show();
            }
            else if (btn == BtnFishBag)
            {
                // FishBagPanel.Show();
                FishingShopPanel.Show();
            }
            else if (btn == BtnMake)
            {
                BagSlotPanel.Show();
                // MakePanel.Show();
            }
            else if (btn == BtnMap)
            {
                MapPanel.Show();
            }
        }
    }
}