From 0c7f8fa2ad32621d66461c4d9de4e1805468f663 Mon Sep 17 00:00:00 2001 From: liuliang <597380732@qq.com> Date: Sun, 29 Dec 2024 19:51:11 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8E=A9=E5=AE=B6=E7=82=B9=E5=87=BB=E5=87=86?= =?UTF-8?q?=E5=A4=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xiaofang/Assets/ProtoBuf/test.cs | 1 + xiaofang/Assets/Res/gsj/scripts/ReadRoom.cs | 2 + xiaofang/Assets/Res/gsj/scripts/Starthost.cs | 2 + xiaofang/Assets/Res/gsj/test111.cs | 2 +- xiaofang/Assets/Scenes/Tmap 1.unity | 94 ++++++++++---------- 5 files changed, 54 insertions(+), 47 deletions(-) diff --git a/xiaofang/Assets/ProtoBuf/test.cs b/xiaofang/Assets/ProtoBuf/test.cs index 9665b428..17fb6350 100644 --- a/xiaofang/Assets/ProtoBuf/test.cs +++ b/xiaofang/Assets/ProtoBuf/test.cs @@ -60,6 +60,7 @@ public class test : MonoBehaviour public void JoinRoom(string roomid) { JoinRoomRequest data = new JoinRoomRequest(); + data.RoomId = roomid; WSMessage msg = new WSMessage(); msg.Module = "hall"; diff --git a/xiaofang/Assets/Res/gsj/scripts/ReadRoom.cs b/xiaofang/Assets/Res/gsj/scripts/ReadRoom.cs index 937e0e31..d29bd3db 100644 --- a/xiaofang/Assets/Res/gsj/scripts/ReadRoom.cs +++ b/xiaofang/Assets/Res/gsj/scripts/ReadRoom.cs @@ -18,6 +18,7 @@ public class ReadRoom : MonoBehaviour private bool isStartRoom = false;//主持人是否已经点击演练开始 public bool iszongzhihui = false; public int RoleId; + public string roomid; public loginData playerdetail; public test test; // Start is called before the first frame update @@ -184,6 +185,7 @@ public class ReadRoom : MonoBehaviour //Player.CSZS.SetPlayerID(room.PlayerList[i].RoleId); Debug.Log("可以直接进入房间"); test.JoinRoom(room.RoomId); + roomid = room.RoomId; SceneManager.LoadScene("Tmap 1"); //if(GlobalData.ServerData.data.openId==) //.isenter = true; diff --git a/xiaofang/Assets/Res/gsj/scripts/Starthost.cs b/xiaofang/Assets/Res/gsj/scripts/Starthost.cs index 5d7d77b4..4a8a0447 100644 --- a/xiaofang/Assets/Res/gsj/scripts/Starthost.cs +++ b/xiaofang/Assets/Res/gsj/scripts/Starthost.cs @@ -40,6 +40,7 @@ public class Starthost : MonoBehaviour public bool ishost=false; public Button ready; private Image image; + public test test; //语音内容 public GameObject walkieTalkieIcon; // 对讲机图标(动态效果) @@ -143,6 +144,7 @@ public class Starthost : MonoBehaviour { image.gameObject.SetActive(true); ready.gameObject.SetActive(false); + test.JoinRoom(ReadRoom.instance.roomid); } // 停止计时并重置时间显示的方法 public void StopTimer() diff --git a/xiaofang/Assets/Res/gsj/test111.cs b/xiaofang/Assets/Res/gsj/test111.cs index 81e7f8a9..cd8cfb9f 100644 --- a/xiaofang/Assets/Res/gsj/test111.cs +++ b/xiaofang/Assets/Res/gsj/test111.cs @@ -29,7 +29,7 @@ public class test111 : MonoBehaviour camera1.gameObject.SetActive(true); } } - + // Update is called once per frame void Update() { diff --git a/xiaofang/Assets/Scenes/Tmap 1.unity b/xiaofang/Assets/Scenes/Tmap 1.unity index 3dcd3f68..3d205f65 100644 --- a/xiaofang/Assets/Scenes/Tmap 1.unity +++ b/xiaofang/Assets/Scenes/Tmap 1.unity @@ -6157,6 +6157,52 @@ MeshCollider: m_Convex: 0 m_CookingOptions: 30 m_Mesh: {fileID: 3461206218701573744, guid: 0c9b084f2070bda45b87da961d2eb0f6, type: 3} +--- !u!1 &203750394 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 203750396} + - component: {fileID: 203750395} + m_Layer: 0 + m_Name: BurstCollisionWorld + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &203750395 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 203750394} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f1a161c4294214a4fbcb7e9e94800494, type: 3} + m_Name: + m_EditorClassIdentifier: + cellSpans: + m_AlignBytes: 16 +--- !u!4 &203750396 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 203750394} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 43 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1001 &212712606 PrefabInstance: m_ObjectHideFlags: 0 @@ -10715,52 +10761,6 @@ MonoBehaviour: arrowDistanceText: {fileID: 1368271979} edgePadding: 50 textOffset: {x: 0, y: -30} ---- !u!1 &491785396 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 491785398} - - component: {fileID: 491785397} - m_Layer: 0 - m_Name: BurstCollisionWorld - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &491785397 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 491785396} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: f1a161c4294214a4fbcb7e9e94800494, type: 3} - m_Name: - m_EditorClassIdentifier: - cellSpans: - m_AlignBytes: 16 ---- !u!4 &491785398 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 491785396} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 43 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &496425324 GameObject: m_ObjectHideFlags: 0 @@ -60663,6 +60663,7 @@ MonoBehaviour: panel1_22: {fileID: 5640692781825168938} ishost: 1 ready: {fileID: 0} + test: {fileID: 1526740601} walkieTalkieIcon: {fileID: 5640692782032870078} dialogueText: {fileID: 5640692781696125076} staticNoiseClip: {fileID: 8300000, guid: 5912e270549bdb04c848923fd9751319, type: 3} @@ -65027,6 +65028,7 @@ MonoBehaviour: panel1_22: {fileID: 0} ishost: 0 ready: {fileID: 0} + test: {fileID: 0} walkieTalkieIcon: {fileID: 0} dialogueText: {fileID: 0} staticNoiseClip: {fileID: 0}