From 023dd663e1c914d8e1ca2a606ffb7177e35d759e Mon Sep 17 00:00:00 2001 From: huyulong <1838407198@qq.com> Date: Sun, 29 Dec 2024 15:03:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E5=85=A5=E6=88=BF=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xiaofang/Assets/ProtoBuf/test.cs | 4 +-- xiaofang/Assets/Res/gsj/scripts/ReadRoom.cs | 4 ++- xiaofang/Assets/Scenes/loginscene.unity | 34 ++++++++++++++++++- .../Assets/Script/hylScripts/TestButton.cs | 2 +- 4 files changed, 39 insertions(+), 5 deletions(-) diff --git a/xiaofang/Assets/ProtoBuf/test.cs b/xiaofang/Assets/ProtoBuf/test.cs index 062275ff..16149872 100644 --- a/xiaofang/Assets/ProtoBuf/test.cs +++ b/xiaofang/Assets/ProtoBuf/test.cs @@ -57,10 +57,10 @@ public class test : MonoBehaviour //加入房间 - public void JoinRoom() + public void JoinRoom(string roomid) { JoinRoomRequest data = new JoinRoomRequest(); - data.RoomId = "168888"; + data.RoomId = roomid; WSMessage msg = new WSMessage(); msg.Module = "hall"; msg.ServiceName = "JoinRoom"; diff --git a/xiaofang/Assets/Res/gsj/scripts/ReadRoom.cs b/xiaofang/Assets/Res/gsj/scripts/ReadRoom.cs index 88f69455..917616dc 100644 --- a/xiaofang/Assets/Res/gsj/scripts/ReadRoom.cs +++ b/xiaofang/Assets/Res/gsj/scripts/ReadRoom.cs @@ -19,6 +19,7 @@ public class ReadRoom : MonoBehaviour public bool iszongzhihui = false; public int RoleId; public loginData playerdetail; + public test test; // Start is called before the first frame update void Start() { @@ -75,7 +76,8 @@ public class ReadRoom : MonoBehaviour //Player.CSZS.SetPlayerID(room.PlayerList[i].RoleId); Debug.Log("可以直接进入房间"); SceneManager.LoadScene("Tmap 1"); - //if(GlobalData.ServerData.data.openId==) + test.JoinRoom(room.RoomId); + //if,(GlobalData.ServerData.data.openId==) //isenter = true; found = true; // 找到匹配用户 ID break; // 直接跳出循环 diff --git a/xiaofang/Assets/Scenes/loginscene.unity b/xiaofang/Assets/Scenes/loginscene.unity index 7ba68b49..9c338633 100644 --- a/xiaofang/Assets/Scenes/loginscene.unity +++ b/xiaofang/Assets/Scenes/loginscene.unity @@ -644,7 +644,7 @@ Transform: m_GameObject: {fileID: 158686762} m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} m_LocalPosition: {x: 0, y: 3, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalScale: {x: 1, y: 1, z: 0.99999994} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} @@ -867,6 +867,7 @@ MonoBehaviour: isadministrator: 0 iszongzhihui: 0 RoleId: 0 + test: {fileID: 7695717545649794846} --- !u!114 &252707977 MonoBehaviour: m_ObjectHideFlags: 0 @@ -4870,6 +4871,8 @@ GameObject: m_Component: - component: {fileID: 7695717545649794842} - component: {fileID: 7695717545649794843} + - component: {fileID: 7695717545649794846} + - component: {fileID: 7695717545649794845} m_Layer: 0 m_Name: GameObject m_TagString: Untagged @@ -4877,6 +4880,35 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!114 &7695717545649794845 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7695717545649794844} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 44720823678ca7c42a08f4409ab025ff, type: 3} + m_Name: + m_EditorClassIdentifier: + serverIP: ws://222.212.40.39 + serverPort: 13497 + type: +--- !u!114 &7695717545649794846 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7695717545649794844} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c68b1dcfbba61b44ca68572c16b16b95, type: 3} + m_Name: + m_EditorClassIdentifier: + token: + wEBScriptListener: {fileID: 0} --- !u!222 &7801660036457041520 CanvasRenderer: m_ObjectHideFlags: 0 diff --git a/xiaofang/Assets/Script/hylScripts/TestButton.cs b/xiaofang/Assets/Script/hylScripts/TestButton.cs index d1f90378..403a406d 100644 --- a/xiaofang/Assets/Script/hylScripts/TestButton.cs +++ b/xiaofang/Assets/Script/hylScripts/TestButton.cs @@ -20,7 +20,7 @@ public class TestButton : MonoBehaviour public void JoinRoom() { - test.JoinRoom(); + //test.JoinRoom(); test.CreateNpcHandler(); joinroomBtn.gameObject.SetActive(false); }