// 本脚本只在不存在时会生成一次。已存在不会再次生成覆盖

using FairyGUI;
using Fantasy.Async;
using UnityEngine;
using NBC;
using Fantasy.Entitas;
using NBF.Fishing2;
using UnityEngine.InputSystem;
using UIPanel = NBC.UIPanel;

namespace NBF
{
    public partial class LoginPanel : UIPanel
    {
        protected override void OnInit()
        {
            this.AutoAddClick(OnClick);
        }

        private void OnClick(GComponent btn)
        {
            if (btn == BtnLogin)
            {
                OnLoginClick().Coroutine();
                // Debug.LogError("test");
                // MessageBox.Show();
            }
        }

        private async FTask OnLoginClick()
        {
            await LoginHelper.Login(InputAccount.text);
            
            // await Fishing.Instance.Go(RoleModel.Instance.Info.MapId);
            
            ChatTestPanel.Show();

            // FishingShopPanel.Show();
            
            // BagPanel.Show();
            // BagSlotPanel.Show();
            
            // SettingPanel.Show();
            // HomePanel.Show();
            

            Del();
        }
    }
}