From 6eeddc3cd8aebdf6ecb58213e4f842f82adac3ac Mon Sep 17 00:00:00 2001 From: YangHua <1475658476@qq.com> Date: Wed, 17 Jan 2024 17:06:58 +0800 Subject: [PATCH 1/2] 1 --- Assets/Zion/Scripts/Adam/DragController.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Assets/Zion/Scripts/Adam/DragController.cs b/Assets/Zion/Scripts/Adam/DragController.cs index 7e5ea26d..54e92935 100644 --- a/Assets/Zion/Scripts/Adam/DragController.cs +++ b/Assets/Zion/Scripts/Adam/DragController.cs @@ -51,7 +51,6 @@ public class DragController : MonoBehaviour, IBeginDragHandler, IEndDragHandler, { if (!isThinck) { - model.GetComponent().isPlayer = true; model.GetComponent().isStartRehearsing = GlobalFlag.isStartRehearsing; List temp = UIBootstrap.Instance.GetListParaItemById(deviceID); From a2728310dbb563e77cd06897fbef82823bd8e0e5 Mon Sep 17 00:00:00 2001 From: YangHua <1475658476@qq.com> Date: Wed, 17 Jan 2024 23:00:03 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=97=A0=E4=BA=BA?= =?UTF-8?q?=E6=9C=BA=E5=9E=8B=E5=8F=B7=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Zion/Scripts/Adam/DragController.cs | 4 ++-- Assets/Zion/Scripts/Adam/GameManager.cs | 3 +++ .../Zion/Scripts/ModelFunction/EquipmentCommon.cs | 14 ++++++++------ 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/Assets/Zion/Scripts/Adam/DragController.cs b/Assets/Zion/Scripts/Adam/DragController.cs index 54e92935..ccb4aea0 100644 --- a/Assets/Zion/Scripts/Adam/DragController.cs +++ b/Assets/Zion/Scripts/Adam/DragController.cs @@ -53,10 +53,10 @@ public class DragController : MonoBehaviour, IBeginDragHandler, IEndDragHandler, { model.GetComponent().isPlayer = true; model.GetComponent().isStartRehearsing = GlobalFlag.isStartRehearsing; - List temp = UIBootstrap.Instance.GetListParaItemById(deviceID); - model.GetComponent().FillInTheData(temp); if (model.GetComponent()) model.GetComponent().wrjModel = wrjModel; + List temp = UIBootstrap.Instance.GetListParaItemById(deviceID); + model.GetComponent().FillInTheData(temp); if (!isDragWRJ) { transform.SetAsLastSibling(); diff --git a/Assets/Zion/Scripts/Adam/GameManager.cs b/Assets/Zion/Scripts/Adam/GameManager.cs index b7cd96be..a07ca385 100644 --- a/Assets/Zion/Scripts/Adam/GameManager.cs +++ b/Assets/Zion/Scripts/Adam/GameManager.cs @@ -372,6 +372,9 @@ public class GameManager : MonoSingleton device.transform.position = new Vector3(float.Parse(deviceTran[0]), float.Parse(deviceTran[1]), float.Parse(deviceTran[2])); device.transform.eulerAngles = new Vector3(float.Parse(deviceTran[3]), float.Parse(deviceTran[4]), float.Parse(deviceTran[5])); + int wrjModelCount = int.Parse(data.r2); + if (device.GetComponent()) + device.GetComponent().wrjModel = (WRJModel)wrjModelCount; device.GetComponent().deviceID = data.id; device.GetComponent().FillInTheData(data.list_para); } diff --git a/Assets/Zion/Scripts/ModelFunction/EquipmentCommon.cs b/Assets/Zion/Scripts/ModelFunction/EquipmentCommon.cs index f4f52464..83569447 100644 --- a/Assets/Zion/Scripts/ModelFunction/EquipmentCommon.cs +++ b/Assets/Zion/Scripts/ModelFunction/EquipmentCommon.cs @@ -109,7 +109,7 @@ public class EquipmentCommon : MonoBehaviour spectrumdetection.isStartRehearsing = isStartRehearsing; break; case "微波武器": - Microwaveweapon microwaveweapon= GetComponent(); + Microwaveweapon microwaveweapon = GetComponent(); microwaveweapon.isStartRehearsing = isStartRehearsing; break; default: @@ -133,6 +133,7 @@ public class EquipmentCommon : MonoBehaviour replaceInfoDic.Add("device_name", equipmentCommon.equipmentType); replaceInfoDic.Add("para_list", paraListJson); replaceInfoDic.Add("r1", $"{transform.position.x},{transform.position.y},{transform.position.z},{transform.eulerAngles.x},{transform.eulerAngles.y},{transform.eulerAngles.z}"); + replaceInfoDic.Add("r2", ((int)gameObject.GetComponent().wrjModel).ToString()); StartCoroutine(AsyncWebReq.PostData2(Url_AddDeviceAndGetDeviceId, replaceInfoDic, ResultsInfo => { ReturnDeviceID returnID = JsonConvert.DeserializeObject(ResultsInfo); @@ -166,7 +167,7 @@ public class EquipmentCommon : MonoBehaviour break; case "频谱探测": Spectrumdetection spectrumdetection = GetComponent(); - spectrumdetection.FillInTheData(weaponitemone); + spectrumdetection.FillInTheData(weaponitemone); break; case "微波武器": Microwaveweapon microwaveweapon = GetComponent(); @@ -189,14 +190,15 @@ public class EquipmentCommon : MonoBehaviour UploadLogMain uploadLogMain = new UploadLogMain(); uploadLogMain.PracticeId = GlobalFlag.practiceSubjectID; uploadLogMain.ThinkId = GlobalFlag.currentThinkId; - string log = currentTime + " " + equipmentType + "(" + deviceID + ")"+"生成 "; + string log = currentTime + " " + equipmentType + "(" + deviceID + ")" + "生成 "; uploadLogMain.log = log; uploadLogMains.Add(uploadLogMain); string uploadLogMainJson = JsonConvert.SerializeObject(uploadLogMains); WWWForm wWWForm = new WWWForm(); wWWForm.AddField("data", uploadLogMainJson); Debug.Log(uploadLogMainJson); - StartCoroutine(PostString(Url_Addpracticelog, wWWForm, data => { + StartCoroutine(PostString(Url_Addpracticelog, wWWForm, data => + { Debug.Log(data); })); } @@ -280,7 +282,7 @@ public class EquipmentCommon : MonoBehaviour } break; case "Planedata": - UnmannedAerialVehicleManage unmannedAerialVehicleManage1=GetComponent(); + UnmannedAerialVehicleManage unmannedAerialVehicleManage1 = GetComponent(); if (unmannedAerialVehicleManage1) { UnmannedAerialVehicle unmannedAerialVehicle = unmannedAerialVehicleManage1.unmannedAerialVehicles.Find(x => x.serialNumber == data[2]); @@ -289,7 +291,7 @@ public class EquipmentCommon : MonoBehaviour unmannedAerialVehicle.AddBao(false); } } - break; + break; case "SetToBeDestroyed"://设备被销毁 GameObject Bao = Instantiate(explodePrefab, transform); Bao.transform.localPosition = Vector3.zero;