Files
5.24BuYu/Assets/MyGame/aa/UI/Game/ChineseChess/UIChineseChessDefeated.cs
T
2026-06-27 02:08:23 +08:00

77 lines
2.1 KiB
C#

using Assets.MyGame.Scripts.Net.WebResponses.ChineseChess;
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
public class UIChineseChessDefeated : SubUIBase
{
public Button JiXuYouXi;
public Button FanHuiDaTing;
//---top
public Image avatar_Top;
public TextMeshProUGUI tMP_ID_Top;
public TextMeshProUGUI tMP_Name_Top;
public TextMeshProUGUI coinCountMinus;
//---bottom
public Image avatar_Bottom;
public TextMeshProUGUI tMP_ID_Bottom;
public TextMeshProUGUI tMP_Name_Bottom;
public TextMeshProUGUI coinCountAdd;
public override void Awake()
{
}
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
protected override void OnShow(object args = null)
{
base.OnShow(args);
ChineseChessGameClassList.ChessGameRoom roomData = ((ChineseChessMainPanel)uIManager.parentUIBase).roomData;
coinCountAdd.text = "+" + roomData.gold;
coinCountMinus.text = "-" + roomData.gold;
foreach (var item in roomData.users)
{
if (item.userId == GameManager.Instance.user.BaseInfo.number)
{
//--top
ChineseChessMainPanel.LoadAvatar(avatar_Top, item.userAvatar);
tMP_ID_Top.text = item.userId;
tMP_Name_Top.text = item.userName;
}
else
{
//--bottom
ChineseChessMainPanel.LoadAvatar(avatar_Bottom, item.userAvatar);
tMP_ID_Bottom.text = item.userId;
tMP_Name_Bottom.text = item.userName;
}
}
JiXuYouXi.onClick.RemoveAllListeners();
JiXuYouXi.onClick.AddListener(() =>
{
uIManager.CloseAll();
WebSocketSendList.GetRoomListChineseChess(1);
});
FanHuiDaTing.onClick.RemoveAllListeners();
FanHuiDaTing.onClick.AddListener(() =>
{
UIManager.Instance.Close(UIPanel.MainGamePanelZGXQ);
});
}
}