175 lines
5.0 KiB
C#
175 lines
5.0 KiB
C#
using Assets.MyGame.Scripts.Net;
|
|
using Assets.MyGame.Scripts.Net.API.GameConfig_SubClass;
|
|
using Assets.MyGame.Scripts.Net.APIRequest.Objs;
|
|
using Assets.MyGame.Scripts.Net.APIResponses.HomeMain_User;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class UIHomeMain : UIBase
|
|
{
|
|
public SubUIManager subUIManager;
|
|
public UIPanelAddressConfig panelAddressConfig;
|
|
public Transform SubPanelParent;
|
|
#region 中间
|
|
[Header("风雷之渊")]
|
|
public Button FXYButton;
|
|
[Header("星际迷航")]
|
|
public Button XJMHButton;
|
|
[Header("太古仙墟")]
|
|
public Button TGXXButton;
|
|
[Header("黑化悟空")]
|
|
public Button HHWKButton;
|
|
[Header("中国象棋")]
|
|
public Button ZGXQButton;
|
|
[Header("敬请期待")]
|
|
public Button JQQDButton;
|
|
#endregion
|
|
[Header("两侧按钮")]
|
|
[Header("Left")]
|
|
#region left
|
|
public Button btn_VIP;
|
|
public Button btn_JJJ;
|
|
public Button btn_Activity;
|
|
#endregion
|
|
[Header("Right")]
|
|
#region Right
|
|
public Button btn_Turret;
|
|
public Button btn_ZS;
|
|
public Button btn_Setting;
|
|
#endregion
|
|
[Header("Botton")]
|
|
#region Right
|
|
public Button btn_MonthCard;
|
|
public Button btn_BackPack;
|
|
public Button btn_Announcenment;
|
|
public Button btn_Rank;
|
|
public Button btn_Email;
|
|
public Button btn_SafeBox;
|
|
public Button btn_Service;
|
|
public Button btn_Shop;
|
|
#endregion
|
|
private void Awake()
|
|
{
|
|
subUIManager = new SubUIManager(SubPanelParent, panelAddressConfig,this);
|
|
#region Center
|
|
//defaultButton.onClick.AddListener(() =>
|
|
//{
|
|
// subUIManager.ShowAsync(UIPanel.SelectRoomPenel,GameType.defaultPanel);
|
|
//});
|
|
FXYButton.onClick.AddListener(() =>
|
|
{
|
|
subUIManager.ShowAsync(UIPanel.SelectRoomLeavePenel, GameType.FLZY);
|
|
});
|
|
TGXXButton.onClick.AddListener(() =>
|
|
{
|
|
subUIManager.ShowAsync(UIPanel.SelectRoomLeavePenel, GameType.TGXX);
|
|
});
|
|
ZGXQButton.onClick.AddListener(() =>
|
|
{
|
|
//subUIManager.ShowAsync(UIPanel.SelectRoomPenel, GameType.ZGXQ);
|
|
WebSocketManager.Instance.Connect(SocketType.chess, () =>{
|
|
WebSocketSendList.GetRoomListChineseChess(1);
|
|
});
|
|
|
|
});
|
|
XJMHButton.onClick.AddListener(() =>
|
|
{
|
|
subUIManager.ShowAsync(UIPanel.SelectRoomLeavePenel, GameType.XJMH);
|
|
|
|
});
|
|
HHWKButton.onClick.AddListener(() =>
|
|
{
|
|
subUIManager.ShowAsync(UIPanel.SelectRoomLeavePenel, GameType.HHWK);
|
|
});
|
|
JQQDButton.onClick.AddListener(() =>
|
|
{
|
|
//这里弹出一行字
|
|
});
|
|
#endregion
|
|
|
|
#region left
|
|
btn_VIP.onClick.AddListener(() =>
|
|
{
|
|
subUIManager.ShowAsync(UIPanel.VIPPenel);
|
|
});
|
|
btn_JJJ.onClick.AddListener(() =>
|
|
{
|
|
subUIManager.ShowAsync(UIPanel.JJJPenel);
|
|
});
|
|
btn_Activity.onClick.AddListener(() =>
|
|
{
|
|
subUIManager.ShowAsync(UIPanel.ActivityPenel);
|
|
});
|
|
#endregion
|
|
|
|
#region right
|
|
btn_Setting.onClick.AddListener(() =>
|
|
{
|
|
subUIManager.ShowAsync(UIPanel.SettingPanel);
|
|
});
|
|
btn_Turret.onClick.AddListener(() =>
|
|
{
|
|
subUIManager.ShowAsync(UIPanel.TurretPanel,ItemPanelSelect.Turrect);
|
|
});
|
|
btn_ZS.onClick.AddListener(() =>
|
|
{
|
|
subUIManager.ShowAsync(UIPanel.ZSPanel, ItemPanelSelect.ZS);
|
|
});
|
|
#endregion
|
|
|
|
#region Bottom
|
|
|
|
btn_MonthCard.onClick.AddListener(() =>
|
|
{
|
|
subUIManager.ShowAsync(UIPanel.MonthCardPanel);
|
|
});
|
|
btn_BackPack.onClick.AddListener(() =>
|
|
{
|
|
subUIManager.ShowAsync(UIPanel.BackPackPanel);
|
|
});
|
|
btn_Announcenment.onClick.AddListener(() =>
|
|
{
|
|
subUIManager.ShowAsync(UIPanel.AnnouncementPanel);
|
|
});
|
|
btn_Rank.onClick.AddListener(() =>
|
|
{
|
|
subUIManager.ShowAsync(UIPanel.RankPanel);
|
|
});
|
|
btn_Email.onClick.AddListener(() =>
|
|
{
|
|
|
|
APIRequestList.GetEmailByPage(new GetEmailByPageObj
|
|
{
|
|
keyWord = "",
|
|
pageIndex = 0,
|
|
pageSize = 200,
|
|
readStatus = 0
|
|
}, (GetEmailByPageResponse) =>
|
|
{
|
|
subUIManager.ShowAsync(UIPanel.EmailPanel,GetEmailByPageResponse);
|
|
});
|
|
//subUIManager.ShowAsync(UIPanel.EmailPanel);
|
|
});
|
|
btn_SafeBox.onClick.AddListener(() =>
|
|
{
|
|
subUIManager.ShowAsync(UIPanel.SafeBoxPanel);
|
|
});
|
|
btn_Service.onClick.AddListener(() =>
|
|
{
|
|
subUIManager.ShowAsync(UIPanel.ServicePanel);
|
|
});
|
|
btn_Shop.onClick.AddListener(() =>
|
|
{
|
|
subUIManager.ShowAsync(UIPanel.ShopPanel);
|
|
});
|
|
#endregion
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|