From 4a9233364c113ee86d91065e6a2020a0aca4fb38 Mon Sep 17 00:00:00 2001 From: huyulong <1838407198@qq.com> Date: Fri, 3 Jan 2025 11:38:37 +0800 Subject: [PATCH] 11 --- xiaofang/Assets/ProtoBuf/test.cs | 3 ++- xiaofang/Assets/Res/gsj/scripts/Starthost.cs | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/xiaofang/Assets/ProtoBuf/test.cs b/xiaofang/Assets/ProtoBuf/test.cs index bda62af0..df259883 100644 --- a/xiaofang/Assets/ProtoBuf/test.cs +++ b/xiaofang/Assets/ProtoBuf/test.cs @@ -904,7 +904,7 @@ string HandleButtoncallId=11;// } if (userJoinResponse.MessageType == 11)//房间开始 { - GameObject.Find("HostCanvas").GetComponent().isSatisfy = true; + Debug.LogWarning("房间开始"); test111.instance.Oppanel(); } if (userJoinResponse.MessageType == 12)//玩家准备 @@ -913,6 +913,7 @@ string HandleButtoncallId=11;// { Debug.Log("服务器给准备好消息"); GameObject.Find("HostCanvas").GetComponent().start.interactable = true; + GameObject.Find("HostCanvas").GetComponent().isSatisfy = true; } } diff --git a/xiaofang/Assets/Res/gsj/scripts/Starthost.cs b/xiaofang/Assets/Res/gsj/scripts/Starthost.cs index 459000e5..c32da211 100644 --- a/xiaofang/Assets/Res/gsj/scripts/Starthost.cs +++ b/xiaofang/Assets/Res/gsj/scripts/Starthost.cs @@ -63,6 +63,7 @@ public class Starthost : MonoBehaviour } void Start() { + test.lodingWebSocket(ReadRoom.instance.ID); closeBtn.onClick.AddListener(() => { Renyuan.SetActive(false); @@ -104,8 +105,10 @@ public class Starthost : MonoBehaviour ready.gameObject.SetActive(false); posiBtn.gameObject.SetActive(true); start.gameObject.SetActive(true); + test.JoinRoom(ReadRoom.instance.roomid); + test.PlayerReady(ReadRoom.instance.roomid, true); } - test.lodingWebSocket(ReadRoom.instance.ID); + } void OnEnable() {