From f74bd5067834dd7a497eb19522738a60334eeb89 Mon Sep 17 00:00:00 2001 From: YangHua <1475658476@qq.com> Date: Tue, 21 Nov 2023 09:42:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=94=9F=E6=88=90=E6=96=B9?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AdamTraining_pilot_terminal_panl 1.unity | 13 +++++++------ Assets/Zion/Scripts/Adam/GameManager.cs | 19 ++++++++++++------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/Assets/Zion/Scenes/AdamTraining_pilot_terminal_panl 1.unity b/Assets/Zion/Scenes/AdamTraining_pilot_terminal_panl 1.unity index 343e9174..362a3e99 100644 --- a/Assets/Zion/Scenes/AdamTraining_pilot_terminal_panl 1.unity +++ b/Assets/Zion/Scenes/AdamTraining_pilot_terminal_panl 1.unity @@ -38,7 +38,7 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 1113159741} - m_IndirectSpecularColor: {r: 0.16215044, g: 0.3062308, b: 0.67089945, a: 1} + m_IndirectSpecularColor: {r: 0.030100383, g: 0.03369107, b: 0.03534769, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: @@ -6648,6 +6648,7 @@ MonoBehaviour: huoPaoCtrls: [] modelname_text: {fileID: 0} isDragWRJ: 1 + deviceID: --- !u!1 &147647007 GameObject: m_ObjectHideFlags: 0 @@ -48292,10 +48293,10 @@ MonoBehaviour: tenkokuModule: {fileID: 1820978573} modelsInfo: [] dviceContent: {fileID: 1744702645} - wrjDrag: {fileID: 3625114603376075994, guid: 504e1e72e287c0740a66218ad23fbd0e, type: 3} - ldDrag: {fileID: 5970882834628802619, guid: beb8d369a0f07564994bb270fef9a929, type: 3} - hpDrag: {fileID: 3438159622267457516, guid: d24981e1d16301c47a2c5d83b9d4e456, type: 3} - wxdDrag: {fileID: 3438159622267457516, guid: 57c5ff12282ea37439abe26b94bc93b3, type: 3} + wrjDrag: {fileID: 3625114603413174334, guid: 504e1e72e287c0740a66218ad23fbd0e, type: 3} + ldDrag: {fileID: 5970882834658551007, guid: beb8d369a0f07564994bb270fef9a929, type: 3} + hpDrag: {fileID: 3438159622238491400, guid: d24981e1d16301c47a2c5d83b9d4e456, type: 3} + wxdDrag: {fileID: 3438159622238491400, guid: 57c5ff12282ea37439abe26b94bc93b3, type: 3} Teacher: {fileID: 754191141} student: {fileID: 1862065805184089353} --- !u!4 &1436809530 @@ -62188,7 +62189,7 @@ MonoBehaviour: m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 - randSeed: 41044140 + randSeed: 122322625 isDoingTransition: 0 minimumHeight: 0 --- !u!114 &1820978574 diff --git a/Assets/Zion/Scripts/Adam/GameManager.cs b/Assets/Zion/Scripts/Adam/GameManager.cs index 5b658adf..71301710 100644 --- a/Assets/Zion/Scripts/Adam/GameManager.cs +++ b/Assets/Zion/Scripts/Adam/GameManager.cs @@ -112,7 +112,7 @@ public class GameManager : MonoBehaviour yield return new WaitForSeconds(0.5f); Debug.Log(msg); string[] data = msg.Split(','); - + switch (data[0]) { case "online": @@ -134,18 +134,16 @@ public class GameManager : MonoBehaviour } break; case "无人机List": - GameObject wrj = Instantiate(wrjDrag.model); - wrj.transform.position = new Vector3(float.Parse(data[1]), float.Parse(data[2]), float.Parse(data[3])); - wrj.transform.eulerAngles = new Vector3(float.Parse(data[4]), float.Parse(data[5]), float.Parse(data[6])); + SpawnDevice(wrjDrag, data); break; case "地面无线电干扰": - + SpawnDevice(wxdDrag, data); break; case "探测雷达": - + SpawnDevice(ldDrag, data); break; case "激光火控平台": - + SpawnDevice(hpDrag, data); break; case "Stop": GlobalFlag.isStartRehearsing = false; @@ -167,6 +165,13 @@ public class GameManager : MonoBehaviour } } + public void SpawnDevice(DragController deviceDragBtn, string[] data) + { + GameObject obj = Instantiate(deviceDragBtn.model); + obj.transform.position = new Vector3(float.Parse(data[1]), float.Parse(data[2]), float.Parse(data[3])); + obj.transform.eulerAngles = new Vector3(float.Parse(data[4]), float.Parse(data[5]), float.Parse(data[6])); + } + private void OnGetRoomUsers(string obj) { if (string.IsNullOrWhiteSpace(obj)) return;