Files
5.24BuYu/Assets/MyGame/aa/UI/Game/ChineseChess/UIChineseChessCreateRoom.cs
T
2026-02-13 19:23:01 +08:00

65 lines
2.1 KiB
C#

using Assets.MyGame.Scripts.Net.WebResponses.ChineseChess;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class UIChineseChessCreateRoom : SubUIBase
{
public Button btn_CreateRoom_Hei;
public Button btn_CreateRoom_Red;
// Start is called before the first frame update
public override void Awake()
{
base.Awake();
//btn_CreateRoom.onClick.AddListener(() =>
//{
// WebSocketSendList.CreateRoomChineseChess(new Assets.MyGame.Scripts.Net.WebResponses.ChineseChess.ChineseChessGameClassList.CreateRoomParam
// {
// gameType=1,
// });
//});
}
protected override void OnShow(object args = null)
{
base.OnShow(args);
if (args != null)
{
var v = (ChineseChessGameClassList.ChessGameRoom)args;
btn_CreateRoom_Hei.onClick.RemoveAllListeners();
btn_CreateRoom_Red.onClick.RemoveAllListeners();
btn_CreateRoom_Hei.onClick.AddListener(() =>
{
WebSocketSendList.CreateRoomChineseChess(new Assets.MyGame.Scripts.Net.WebResponses.ChineseChess.ChineseChessGameClassList.CreateRoomParam
{
gameType = 1,
gold = 1000,
password = "123456",
roomId=v.roomId,
userId= GameManager.Instance.user.id
});
});
btn_CreateRoom_Red.onClick.AddListener(() =>
{
WebSocketSendList.CreateRoomChineseChess(new Assets.MyGame.Scripts.Net.WebResponses.ChineseChess.ChineseChessGameClassList.CreateRoomParam
{
gameType = 2,
gold = 1000,
password = "123456",
roomId = v.roomId,
userId = GameManager.Instance.user.id
});
});
}
}
// Update is called once per frame
void Update()
{
}
}