From b5a888998ce9a11ec945aad20c43e882f29e8ede Mon Sep 17 00:00:00 2001 From: YangHua <1475658476@qq.com> Date: Thu, 18 Jan 2024 16:50:37 +0800 Subject: [PATCH] re --- Assets/Zion/Scripts/ModelFunction/EquipmentCommon.cs | 3 ++- .../ModelFunction/UAV/UnmannedAerialVehicleManage.cs | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Assets/Zion/Scripts/ModelFunction/EquipmentCommon.cs b/Assets/Zion/Scripts/ModelFunction/EquipmentCommon.cs index 83569447..abf4c5d5 100644 --- a/Assets/Zion/Scripts/ModelFunction/EquipmentCommon.cs +++ b/Assets/Zion/Scripts/ModelFunction/EquipmentCommon.cs @@ -133,7 +133,8 @@ 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()); + if (gameObject.GetComponent()) + replaceInfoDic.Add("r2", ((int)gameObject.GetComponent().wrjModel).ToString()); StartCoroutine(AsyncWebReq.PostData2(Url_AddDeviceAndGetDeviceId, replaceInfoDic, ResultsInfo => { ReturnDeviceID returnID = JsonConvert.DeserializeObject(ResultsInfo); diff --git a/Assets/Zion/Scripts/ModelFunction/UAV/UnmannedAerialVehicleManage.cs b/Assets/Zion/Scripts/ModelFunction/UAV/UnmannedAerialVehicleManage.cs index cc5973db..c2a1e220 100644 --- a/Assets/Zion/Scripts/ModelFunction/UAV/UnmannedAerialVehicleManage.cs +++ b/Assets/Zion/Scripts/ModelFunction/UAV/UnmannedAerialVehicleManage.cs @@ -450,9 +450,9 @@ public class UnmannedAerialVehicleManage : MonoBehaviour } ///根据风得速度改变无人机得速度 - FireSpeed = float.Parse(maximumFlyingSpeed) / int.Parse(currentSceneInfo.EnvWindSpeed); - ///如果风速大于6级,无人机停止飞行 - if (int.Parse(currentSceneInfo.EnvWindSpeed) > 6) + FireSpeed = float.Parse(maximumFlyingSpeed) / float.Parse(currentSceneInfo.EnvWindSpeed); + /////如果风速大于6级,无人机停止飞行 + if (float.Parse(currentSceneInfo.EnvWindSpeed) * 10 > 6) { FireSpeed = 0; }