This commit is contained in:
yulong 2024-01-18 16:52:22 +08:00
parent 79b6304635
commit d911387140
4 changed files with 24 additions and 13 deletions

View File

@ -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<UnmannedAerialVehicleManage>().wrjModel).ToString());
if (gameObject.GetComponent<UnmannedAerialVehicleManage>())
replaceInfoDic.Add("r2", ((int)gameObject.GetComponent<UnmannedAerialVehicleManage>().wrjModel).ToString());
StartCoroutine(AsyncWebReq.PostData2(Url_AddDeviceAndGetDeviceId, replaceInfoDic, ResultsInfo =>
{
ReturnDeviceID returnID = JsonConvert.DeserializeObject<ReturnDeviceID>(ResultsInfo);

View File

@ -145,6 +145,7 @@ public class LaserFireControlPlatformManger : MonoBehaviour
/// 激光火炮打击时间
/// </summary>
public static float lasertime;
public float lasertimes;
/// <summary>
/// 判断物体是否在相机里面
/// </summary>
@ -187,6 +188,10 @@ public class LaserFireControlPlatformManger : MonoBehaviour
void Update()
{
if (lasertime>0)
{
lasertime -= Time.deltaTime;
}
//if (UIBootstrap.Instance.GetRoleByIDPracticeId(GlobalFlag.practiceSeatId) != "0"&&Input.GetMouseButtonDown(0))
//{
// if (!EventSystem.current.IsPointerOverGameObject())
@ -195,6 +200,7 @@ public class LaserFireControlPlatformManger : MonoBehaviour
// Front = true;
// }
//}
if (UIBootstrap.Instance.GetRoleByIDPracticeId(GlobalFlag.practiceSeatId) != "0" && Input.GetMouseButtonDown(0))
{
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
@ -298,6 +304,7 @@ public class LaserFireControlPlatformManger : MonoBehaviour
case "储能间隔时间:":
StorageIntervalTime = weaponitemone[i].para_value;
lasertime = float.Parse(StorageIntervalTime);
lasertimes = float.Parse(StorageIntervalTime);
break;
case "毁伤目标累积作用时间:":
CumulativeActionTimeOfDamageTarget = weaponitemone[i].para_value;
@ -549,6 +556,10 @@ public class LaserFireControlPlatformManger : MonoBehaviour
OuterLaserlineRenderer.SetPosition(0, LaserPoint.transform.position); // 设置线段起点为物体位置
OuterLaserlineRenderer.SetPosition(1, LaserPoint.transform.position); // 设置线段终点为目标点
}
if (lasertimes!=0)
{
lasertime = lasertimes;
}
isLasing = false;
}

View File

@ -121,7 +121,7 @@ public class RadarManger : MonoBehaviour
/// <summary>
/// 计时火炮蓄能时间
/// </summary>
public float radartime;
public float radartime=0;
void Start()
{
Mincamera = GameObject.Find("Minimap Camera").GetComponent<Camera>();
@ -305,19 +305,18 @@ public class RadarManger : MonoBehaviour
UnmannedAerialVehicle unmannedAerialVehicle = colliders2[i].GetComponent<UnmannedAerialVehicle>();
if (unmannedAerialVehicle)
{
radartime += Time.deltaTime;
if (radartime>=LaserFireControlPlatformManger.lasertime)
if (radartime == LaserFireControlPlatformManger.lasertime)
{
Debug.Log("今来了");
LaserFireControlPlatformManger laserFireControlPlatformManger = LaserFireControlPlatformManger.laserFireControlPlatformMangers.Find(x => (x != null && x.isLasing == false));
radartime = 0;
if (laserFireControlPlatformManger)
if (laserFireControlPlatformManger)
{
laserFireControlPlatformManger.isLasing = true;
//Debug.Log(laserFireControlPlatformManger.transform.name + "攻击无人机: " + unmannedAerialVehicle.transform.name);
laserFireControlPlatformManger.targetPoint = unmannedAerialVehicle.transform;
laserFireControlPlatformManger.Crosshair();
laserFireControlPlatformManger.Lasing();
radartime = 0;
}
}
number++;

View File

@ -449,13 +449,13 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
break;
}
///根据风得速度改变无人机得速度
FireSpeed = float.Parse(maximumFlyingSpeed) / int.Parse(currentSceneInfo.EnvWindSpeed);
///如果风速大于6级无人机停止飞行
if (int.Parse(currentSceneInfo.EnvWindSpeed) > 6)
{
FireSpeed = 0;
}
/////根据风得速度改变无人机得速度
//FireSpeed = float.Parse(maximumFlyingSpeed) / int.Parse(currentSceneInfo.EnvWindSpeed);
/////如果风速大于6级无人机停止飞行
//if (int.Parse(currentSceneInfo.EnvWindSpeed) > 6)
//{
// FireSpeed = 0;
//}
CheckRSC();
if (i == (weaponitemone.Count - 1))
{