Files
5.24BuYu/Assets/MyGame/aa/UI/Game/ChineseChess/UIChineseChessRoomExplain.cs
T
2026-02-26 11:05:56 +08:00

45 lines
1.5 KiB
C#

using Assets.MyGame.Scripts.Net;
using Assets.MyGame.Scripts.Net.WebResponses.ChineseChess;
using Newtonsoft.Json;
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
using static Assets.MyGame.Scripts.Net.WebResponses.ChineseChess.ChineseChessGameClassList;
public class UIChineseChessRoomExplain : SubUIBase
{
public TextMeshProUGUI tmp_roomExplain;
public TextMeshProUGUI password;
public Button consent;
public override void Awake()
{
btn_Close.onClick.AddListener(() =>
{
uIManager.CloseAll();
WebSocketSendList.GetRoomListChineseChess(1);
});
}
protected override void OnShow(object args = null)
{
base.OnShow(args);
if (args != null)
{
var v = JsonConvert.DeserializeObject<WebSocketResponseBase<ChessGameRoom>>(args.ToString()).arguments[0];
//设置完分数更新房间信息
((ChineseChessMainPanel)uIManager.parentUIBase).roomData = v;
tmp_roomExplain.text = "局时:无限制\n" + "步时:60秒\n读秒:30\n底分:" + v.gold;
password.text = v.password;
consent.onClick.RemoveAllListeners();
consent.onClick.AddListener(() =>
{
WebSocketSendList.GameReadyChineseChess(v.roomId,GameManager.Instance.user.id);
uIManager.Close(UIPanel.ZGXQGameExplain);
});
}
}
}