diff --git a/xiaofang/Assets/Prefabs/PanelPrefabs/Command_End.prefab b/xiaofang/Assets/Prefabs/PanelPrefabs/Command_End.prefab index 0c3656ec..06431398 100644 --- a/xiaofang/Assets/Prefabs/PanelPrefabs/Command_End.prefab +++ b/xiaofang/Assets/Prefabs/PanelPrefabs/Command_End.prefab @@ -278,7 +278,7 @@ RectTransform: m_Children: - {fileID: 1293464008} m_Father: {fileID: 1986279549173157411} - m_RootOrder: 9 + m_RootOrder: 8 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} @@ -1904,7 +1904,7 @@ RectTransform: - {fileID: 4241744839987377620} - {fileID: 1986279548018498150} m_Father: {fileID: 1986279549173157411} - m_RootOrder: 12 + m_RootOrder: 11 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} @@ -2267,7 +2267,7 @@ RectTransform: m_Children: - {fileID: 1986279548998433690} m_Father: {fileID: 1986279549173157411} - m_RootOrder: 7 + m_RootOrder: 6 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 1} m_AnchorMax: {x: 0.5, y: 1} @@ -4922,7 +4922,7 @@ RectTransform: - {fileID: 5988372281440126046} - {fileID: 1986279547444996170} m_Father: {fileID: 1986279549173157411} - m_RootOrder: 11 + m_RootOrder: 10 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} @@ -5360,7 +5360,7 @@ RectTransform: m_Children: - {fileID: 1986279547868170080} m_Father: {fileID: 1986279549173157411} - m_RootOrder: 6 + m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} @@ -6724,7 +6724,7 @@ RectTransform: - {fileID: 1986279548228542620} - {fileID: 11656889} m_Father: {fileID: 1986279549173157411} - m_RootOrder: 10 + m_RootOrder: 9 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 1, y: 0.5} m_AnchorMax: {x: 1, y: 0.5} @@ -7043,7 +7043,7 @@ RectTransform: m_Children: - {fileID: 1986279547479261576} m_Father: {fileID: 1986279549173157411} - m_RootOrder: 8 + m_RootOrder: 7 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 1, y: 0} m_AnchorMax: {x: 1, y: 0} @@ -7285,7 +7285,6 @@ RectTransform: m_Children: - {fileID: 8910930061191087685} - {fileID: 4309186515595606845} - - {fileID: 1986279549438857642} - {fileID: 21171491440440172} - {fileID: 1986279549232645824} - {fileID: 5670965382466002809} @@ -7296,6 +7295,7 @@ RectTransform: - {fileID: 1986279549107877076} - {fileID: 1986279548675747997} - {fileID: 1986279547715622014} + - {fileID: 1986279549438857642} m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -7417,6 +7417,7 @@ MonoBehaviour: isFrist: 0 luxianSure: {fileID: 1056641196} luxianSureText: {fileID: 1359140487} + NPCAA: -1 gridLayoutGroup: {fileID: 3221337158919056189} isluxian: 0 TempNPC: @@ -7529,7 +7530,7 @@ RectTransform: m_Children: - {fileID: 1986279547426150003} m_Father: {fileID: 1986279549173157411} - m_RootOrder: 4 + m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} @@ -8216,7 +8217,7 @@ RectTransform: m_Children: - {fileID: 3529429583829166167} m_Father: {fileID: 1986279549173157411} - m_RootOrder: 2 + m_RootOrder: 12 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} @@ -8720,7 +8721,7 @@ RectTransform: - {fileID: 1986279547719244042} - {fileID: 4386558475453932289} m_Father: {fileID: 1986279549173157411} - m_RootOrder: 5 + m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} @@ -9032,7 +9033,7 @@ RectTransform: - {fileID: 1986279549149379712} - {fileID: 1986279548911559932} m_Father: {fileID: 1986279549173157411} - m_RootOrder: 3 + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} diff --git a/xiaofang/Assets/ProtoBuf/test.cs b/xiaofang/Assets/ProtoBuf/test.cs index 6538a8be..ac13a31b 100644 --- a/xiaofang/Assets/ProtoBuf/test.cs +++ b/xiaofang/Assets/ProtoBuf/test.cs @@ -554,10 +554,28 @@ public class test : MonoBehaviour wEBScriptListener.SendMessageByte(sendData); } - - - - + + public void StartGameDrill(string roomId) + { + JoinRoomRequest data = new JoinRoomRequest(); + data.RoomId = roomId; + + + + WSMessage msg = new WSMessage(); + msg.Module = "select"; + msg.ServiceName = "GetSelectHistoryList"; + msg.Data = ByteString.CopyFrom(ProtoBufffer.Serialize(data)); + byte[] sendData = ProtoBufffer.Serialize(msg); + WSMessage deinfo = ProtoBufffer.DeSerialize(sendData); + JoinRoomRequest login = ProtoBufffer.DeSerialize(deinfo.Data.ToByteArray()); + Debug.Log("==========消息转发函数调用"); + //BroadcastFrameMsg.FramesFieldNumber + + wEBScriptListener.SendMessageByte(sendData); + } + + // Start is called before the first frame update @@ -782,6 +800,10 @@ public class test : MonoBehaviour { test111.instance.Oppanel(); } + if (userJoinResponse.MessageType == 12)//玩家准备 + { + GameObject.Find("HostCanvas").GetComponent().isSatisfy=true; + } break; diff --git a/xiaofang/Assets/Res/gsj/scripts/ReadRoom.cs b/xiaofang/Assets/Res/gsj/scripts/ReadRoom.cs index d29bd3db..a18ae15f 100644 --- a/xiaofang/Assets/Res/gsj/scripts/ReadRoom.cs +++ b/xiaofang/Assets/Res/gsj/scripts/ReadRoom.cs @@ -1,6 +1,7 @@ using System; using System.Collections; using System.Collections.Generic; +using Unity.Mathematics; using UnityEngine; using UnityEngine.Analytics; using UnityEngine.SceneManagement; @@ -111,6 +112,55 @@ public class ReadRoom : MonoBehaviour } + } + else + { + Debug.LogError("获取房间列表失败!"); + } + }public async bool roompanmduan() + { + var response = await gameRoomListInstance.getGameRoomList(); + if (response != null && response.Data != null) + { + if (GlobalData.ServerData.data.isCreater == "Y") + { + + } + roomDataList = response.Data; + Debug.Log($"获取到的房间数量:{roomDataList.Count}"); + + + // 调用方法,动态生成房间元素 + foreach (var room in roomDataList) + { + if (room.Status == "1" || room.Status == "0") + { + bool found = false; // 标记是否找到匹配的用户 ID + if (!isStartRoom) + { + for (int i = 0; i < room.PlayerList.Count; i++) + { + Debug.LogError(GlobalData.ServerData.data.userId); + Debug.LogError(1111111111111111111); + Debug.LogError(room.PlayerList[i].UserId); + if ((GlobalData.ServerData.data.userId == room.PlayerList[i].UserId) && (formattedDate == room.ReserveDate)) + { + + //传人物职业ID + //Player.CSZS.SetPlayerID(room.PlayerList[i].RoleId); + Debug.Log("可以直接进入房间"); + SceneManager.LoadScene("Tmap 1"); + Debug.Log(room.RoomId); + test.JoinRoom(room.RoomId); + //if,(GlobalData.ServerData.data.openId==) + //isenter = true; + found = true; // 找到匹配用户 ID + break; // 直接跳出循环 + } + } + } + } + } } else { diff --git a/xiaofang/Assets/Res/gsj/scripts/Starthost.cs b/xiaofang/Assets/Res/gsj/scripts/Starthost.cs index c1b7f2f6..bcd47faa 100644 --- a/xiaofang/Assets/Res/gsj/scripts/Starthost.cs +++ b/xiaofang/Assets/Res/gsj/scripts/Starthost.cs @@ -183,6 +183,7 @@ public class Starthost : MonoBehaviour peopleposition.SetActive(false); right.SetActive(false); AnimateUIElementAsync(); + test.StartGameDrill(ReadRoom.instance.roomid); start.interactable = false; // 防止点击事件 //总指挥接警动画 // 开始对讲机效果流程 diff --git a/xiaofang/Assets/Scenes/Tmap 1.unity b/xiaofang/Assets/Scenes/Tmap 1.unity index 3d205f65..f47393c7 100644 --- a/xiaofang/Assets/Scenes/Tmap 1.unity +++ b/xiaofang/Assets/Scenes/Tmap 1.unity @@ -5563,6 +5563,52 @@ Transform: m_CorrespondingSourceObject: {fileID: 499732, guid: 133b581e02aa7f24fa0f99c1b471e108, type: 3} m_PrefabInstance: {fileID: 144336198} m_PrefabAsset: {fileID: 0} +--- !u!1 &149583147 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 149583149} + - component: {fileID: 149583148} + m_Layer: 0 + m_Name: BurstCollisionWorld + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &149583148 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 149583147} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f1a161c4294214a4fbcb7e9e94800494, type: 3} + m_Name: + m_EditorClassIdentifier: + cellSpans: + m_AlignBytes: 16 +--- !u!4 &149583149 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 149583147} + 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 &157238524 GameObject: m_ObjectHideFlags: 0 @@ -6157,52 +6203,6 @@ 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