diff --git a/xiaofang/Assets/ProtoBuf/test.cs b/xiaofang/Assets/ProtoBuf/test.cs index 82b62a56..d5352568 100644 --- a/xiaofang/Assets/ProtoBuf/test.cs +++ b/xiaofang/Assets/ProtoBuf/test.cs @@ -603,7 +603,7 @@ public class test : MonoBehaviour wEBScriptListener.OnCallback += callback; if (wEBScriptListener != null) { - //lodingWebSocket(); + //lodingWebSocket(ReadRoom.instance.ID); //JoinRoom(); Heartbeat(); //BroadcastMessage(); diff --git a/xiaofang/Assets/Res/gsj/scripts/ReadRoom.cs b/xiaofang/Assets/Res/gsj/scripts/ReadRoom.cs index 3019ddd1..f6d35daa 100644 --- a/xiaofang/Assets/Res/gsj/scripts/ReadRoom.cs +++ b/xiaofang/Assets/Res/gsj/scripts/ReadRoom.cs @@ -22,6 +22,7 @@ public class ReadRoom : MonoBehaviour public string roomid; public loginData playerdetail; public test test; + public string ID; // Start is called before the first frame update void Start() { diff --git a/xiaofang/Assets/Res/gsj/scripts/Starthost.cs b/xiaofang/Assets/Res/gsj/scripts/Starthost.cs index e4e4cd4c..d598b00e 100644 --- a/xiaofang/Assets/Res/gsj/scripts/Starthost.cs +++ b/xiaofang/Assets/Res/gsj/scripts/Starthost.cs @@ -104,6 +104,7 @@ public class Starthost : MonoBehaviour posiBtn.gameObject.SetActive(true); start.gameObject.SetActive(true); } + test.lodingWebSocket(ReadRoom.instance.ID); } void OnEnable() { diff --git a/xiaofang/Assets/Script/loginScripts/LoginPanel.cs b/xiaofang/Assets/Script/loginScripts/LoginPanel.cs index 14399eb6..906f390d 100644 --- a/xiaofang/Assets/Script/loginScripts/LoginPanel.cs +++ b/xiaofang/Assets/Script/loginScripts/LoginPanel.cs @@ -59,7 +59,7 @@ public class LoginPanel : Base // 将登录响应数据保存到静态变量中 GlobalData.ServerData = serverData; - + ReadRoom.instance.ID = id.text; test.lodingWebSocket(id.text); // 打印 access_token Debug.Log(serverData.data.access_token);