This commit is contained in:
parent
f0e1e0307c
commit
1e15d4915c
|
@ -623,6 +623,8 @@ MonoBehaviour:
|
||||||
layerMask:
|
layerMask:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_Bits: 256
|
m_Bits: 256
|
||||||
|
startPos: {fileID: 0}
|
||||||
|
hight: 200
|
||||||
--- !u!1 &7326748669528570608
|
--- !u!1 &7326748669528570608
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
@ -10921,6 +10923,36 @@ PrefabInstance:
|
||||||
propertyPath: m_Layer
|
propertyPath: m_Layer
|
||||||
value: 11
|
value: 11
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 6107446376952425967, guid: 088baeb890d17754287a1161c0b1dceb,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_Size.x
|
||||||
|
value: 0.9787081
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 6107446376952425967, guid: 088baeb890d17754287a1161c0b1dceb,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_Center.x
|
||||||
|
value: 0.02213462
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 6107446376952425967, guid: 088baeb890d17754287a1161c0b1dceb,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_Center.z
|
||||||
|
value: -0.3876998
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 6107446376952425967, guid: 088baeb890d17754287a1161c0b1dceb,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_Size.y
|
||||||
|
value: 0.29012477
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 6107446376952425967, guid: 088baeb890d17754287a1161c0b1dceb,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_Center.y
|
||||||
|
value: 0.035689853
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 6107446376952425967, guid: 088baeb890d17754287a1161c0b1dceb,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_Size.z
|
||||||
|
value: 1.052937
|
||||||
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6213446451897815584, guid: 088baeb890d17754287a1161c0b1dceb,
|
- target: {fileID: 6213446451897815584, guid: 088baeb890d17754287a1161c0b1dceb,
|
||||||
type: 3}
|
type: 3}
|
||||||
propertyPath: m_Layer
|
propertyPath: m_Layer
|
||||||
|
@ -11001,6 +11033,11 @@ PrefabInstance:
|
||||||
propertyPath: m_LocalScale.z
|
propertyPath: m_LocalScale.z
|
||||||
value: 2
|
value: 2
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 7591063048475770342, guid: 088baeb890d17754287a1161c0b1dceb,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_LocalPosition.y
|
||||||
|
value: 0.2
|
||||||
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 7633175810598794496, guid: 088baeb890d17754287a1161c0b1dceb,
|
- target: {fileID: 7633175810598794496, guid: 088baeb890d17754287a1161c0b1dceb,
|
||||||
type: 3}
|
type: 3}
|
||||||
propertyPath: m_Layer
|
propertyPath: m_Layer
|
||||||
|
|
|
@ -318,8 +318,8 @@ public class TerrestrialRadioInterferenceManger : MonoBehaviour
|
||||||
if (unmannedAerialVehicleManage)
|
if (unmannedAerialVehicleManage)
|
||||||
{
|
{
|
||||||
unmannedAerialVehicleManage = wrj.GetComponent<UnmannedAerialVehicleManage>();
|
unmannedAerialVehicleManage = wrj.GetComponent<UnmannedAerialVehicleManage>();
|
||||||
//unmannedAerialVehicleManage.CheckSatellitePositioningFrequency(
|
unmannedAerialVehicleManage.CheckSatellitePositioningFrequency(
|
||||||
// InterferenceMode);
|
InterferenceMode);
|
||||||
var nowData = GetSyncData(unmannedAerialVehicleManage);
|
var nowData = GetSyncData(unmannedAerialVehicleManage);
|
||||||
DeviceManager.Instance.send2roomStr.Enqueue(nowData);
|
DeviceManager.Instance.send2roomStr.Enqueue(nowData);
|
||||||
}
|
}
|
||||||
|
@ -327,8 +327,8 @@ public class TerrestrialRadioInterferenceManger : MonoBehaviour
|
||||||
if (unmannedAerialVehicle)
|
if (unmannedAerialVehicle)
|
||||||
{
|
{
|
||||||
unmannedAerialVehicle = wrj.GetComponent<UnmannedAerialVehicle>();
|
unmannedAerialVehicle = wrj.GetComponent<UnmannedAerialVehicle>();
|
||||||
//unmannedAerialVehicle.CheckSatellitePositioningFrequency(
|
unmannedAerialVehicle.CheckSatellitePositioningFrequency(
|
||||||
// InterferenceMode);
|
InterferenceMode);
|
||||||
var nowData = GetSyncData(unmannedAerialVehicle);
|
var nowData = GetSyncData(unmannedAerialVehicle);
|
||||||
DeviceManager.Instance.send2roomStr.Enqueue(nowData);
|
DeviceManager.Instance.send2roomStr.Enqueue(nowData);
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,9 @@ using System.Linq;
|
||||||
using static InterfaceManager;
|
using static InterfaceManager;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using PData;
|
using PData;
|
||||||
|
using TMPro;
|
||||||
|
using UnityEngine.UIElements;
|
||||||
|
using System.Security.Permissions;
|
||||||
|
|
||||||
public enum WRJModel
|
public enum WRJModel
|
||||||
{
|
{
|
||||||
|
@ -764,6 +767,8 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public GameObject startPos;
|
||||||
|
public float hight = 200f;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 开启航线设置
|
/// 开启航线设置
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -786,9 +791,24 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
||||||
DistanceMeasurement distanceMeasurement = airRoute.GetComponent<DistanceMeasurement>();
|
DistanceMeasurement distanceMeasurement = airRoute.GetComponent<DistanceMeasurement>();
|
||||||
if (distanceMeasurement)
|
if (distanceMeasurement)
|
||||||
{
|
{
|
||||||
distanceMeasurement.isPathCanBePlanned = true;
|
if (startPos)
|
||||||
distanceMeasurement.markers[0] = transform;
|
{
|
||||||
distanceMeasurement.unmannedAerialVehicleManage = this;
|
startPos.transform.position = new Vector3(transform.position.x, hight, transform.position.z);
|
||||||
|
distanceMeasurement.isPathCanBePlanned = true;
|
||||||
|
distanceMeasurement.markers[0] = startPos.transform;
|
||||||
|
positions.Enqueue(startPos.transform.position);
|
||||||
|
distanceMeasurement.unmannedAerialVehicleManage = this;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
startPos = Instantiate(distanceMeasurement.PosPrefab,transform);
|
||||||
|
startPos.transform.localScale = Vector3.zero;
|
||||||
|
startPos.transform.position = new Vector3(transform.position.x, hight, transform.position.z);
|
||||||
|
distanceMeasurement.isPathCanBePlanned = true;
|
||||||
|
distanceMeasurement.markers[0] = startPos.transform;
|
||||||
|
positions.Enqueue(startPos.transform.position);
|
||||||
|
distanceMeasurement.unmannedAerialVehicleManage = this;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -812,20 +832,23 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
||||||
|
|
||||||
public IEnumerator MoveObjectAlongPath(Vector3 _positions) // 协程:按路线移动物体
|
public IEnumerator MoveObjectAlongPath(Vector3 _positions) // 协程:按路线移动物体
|
||||||
{
|
{
|
||||||
Vector3 targetPosition = new Vector3(_positions.x, 150, _positions.z);// 目标位置为当前顶点坐标
|
Vector3 targetPosition = new Vector3(_positions.x, hight, _positions.z);// 目标位置为当前顶点坐标
|
||||||
float _distance = Vector3.Distance(transform.position, targetPosition);
|
float _distance = Vector3.Distance(transform.position, targetPosition);
|
||||||
float _time = _distance / FireSpeed;
|
float _time = _distance / FireSpeed;
|
||||||
transform.LookAt(targetPosition);
|
if (_positions.x != transform.position.x && _positions.z != transform.position.z)
|
||||||
|
transform.LookAt(targetPosition);
|
||||||
transform.DOMove(targetPosition, _time).SetEase(Ease.Linear);
|
transform.DOMove(targetPosition, _time).SetEase(Ease.Linear);
|
||||||
yield return new WaitForSeconds(_time); // 等待一帧时间
|
yield return new WaitForSeconds(_time); // 等待一帧时间
|
||||||
isMove = true;
|
isMove = true;
|
||||||
}
|
}
|
||||||
public IEnumerator MoveObjectAlongPath(Vector3 _positions, bool _isMove) // 协程:按路线移动物体
|
public IEnumerator MoveObjectAlongPath(Vector3 _positions, bool _isMove) // 协程:按路线移动物体
|
||||||
{
|
{
|
||||||
Vector3 targetPosition = new Vector3(_positions.x, 200, _positions.z);// 目标位置为当前顶点坐标
|
|
||||||
|
Vector3 targetPosition = new Vector3(_positions.x, hight, _positions.z);// 目标位置为当前顶点坐标
|
||||||
float _distance = Vector3.Distance(transform.position, targetPosition);
|
float _distance = Vector3.Distance(transform.position, targetPosition);
|
||||||
float _time = _distance / FireSpeed;
|
float _time = _distance / FireSpeed;
|
||||||
transform.LookAt(targetPosition);
|
if (_positions.x != transform.position.x && _positions.z != transform.position.z)
|
||||||
|
transform.LookAt(targetPosition);
|
||||||
transform.DOMove(targetPosition, _time).SetEase(Ease.Linear);
|
transform.DOMove(targetPosition, _time).SetEase(Ease.Linear);
|
||||||
yield return new WaitForSeconds(_time); // 等待一帧时间
|
yield return new WaitForSeconds(_time); // 等待一帧时间
|
||||||
equipmentCommon.isMove = _isMove;
|
equipmentCommon.isMove = _isMove;
|
||||||
|
|
Loading…
Reference in New Issue