This commit is contained in:
账号名 2023-11-24 16:44:55 +08:00
parent 84cb3d4a98
commit 67ffe69bc8
4 changed files with 21 additions and 19 deletions

View File

@ -181,7 +181,7 @@ public class EquipmentCommon : MonoBehaviour
Vector3 _positions = positions.Dequeue(); Vector3 _positions = positions.Dequeue();
UnmannedAerialVehicleManage unmannedAerialVehicleManage = GetComponent<UnmannedAerialVehicleManage>(); UnmannedAerialVehicleManage unmannedAerialVehicleManage = GetComponent<UnmannedAerialVehicleManage>();
if (unmannedAerialVehicleManage) if (unmannedAerialVehicleManage)
StartCoroutine(unmannedAerialVehicleManage.MoveObjectAlongPath(_positions, isMove)); // 启动协程,按规划的路线移动物体 StartCoroutine(unmannedAerialVehicleManage.MoveObjectAlongPath(_positions, true)); // 启动协程,按规划的路线移动物体
} }
} }

View File

@ -264,17 +264,19 @@ public class LaserFireControlPlatformManger : MonoBehaviour
public void NonSelfGeneratedEmissionLaser(string[] data) public void NonSelfGeneratedEmissionLaser(string[] data)
{ {
Vector3 vector3 = new Vector3(float.Parse(data[2]), float.Parse(data[3]), float.Parse(data[4])); Vector3 vector3 = new Vector3(float.Parse(data[2]), float.Parse(data[3]), float.Parse(data[4]));
if (InnerLaserlineRenderer) LaserModer.transform.DOLookAt(vector3, 0.1f).OnComplete(() => {
{ if (InnerLaserlineRenderer)
InnerLaserlineRenderer.SetPosition(0, LaserPoint.transform.position); // 设置线段起点为物体位置 {
InnerLaserlineRenderer.SetPosition(1, vector3); // 设置线段终点为目标点 InnerLaserlineRenderer.SetPosition(0, LaserPoint.transform.position); // 设置线段起点为物体位置
} InnerLaserlineRenderer.SetPosition(1, vector3); // 设置线段终点为目标点
if (OuterLaserlineRenderer) }
{ if (OuterLaserlineRenderer)
OuterLaserlineRenderer.SetPosition(0, LaserPoint.transform.position); // 设置线段起点为物体位置 {
OuterLaserlineRenderer.SetPosition(1, vector3); // 设置线段终点为目标点 OuterLaserlineRenderer.SetPosition(0, LaserPoint.transform.position); // 设置线段起点为物体位置
} OuterLaserlineRenderer.SetPosition(1, vector3); // 设置线段终点为目标点
StartCoroutine(LaserExtinction()); }
StartCoroutine(LaserExtinction());
});
} }
private void OnDestroy() private void OnDestroy()

View File

@ -156,9 +156,9 @@ public class UnmannedAerialVehicle : MonoBehaviour
string nowData = string.Format("{0},{1}", "SetToBeDestroyed", _equipmentCommon.deviceID); string nowData = string.Format("{0},{1}", "SetToBeDestroyed", _equipmentCommon.deviceID);
Debug.Log(nowData); Debug.Log(nowData);
_ = SyncCreateRoom.SendMessageAsync(string.Format("send2room {0}", nowData)); _ = SyncCreateRoom.SendMessageAsync(string.Format("send2room {0}", nowData));
Dictionary<string, string> headers = new Dictionary<string, string>(); WWWForm headers = new WWWForm();
headers.Add("id", _equipmentCommon.deviceID); headers.AddField("id", _equipmentCommon.deviceID);
StartCoroutine(GetString(Url_Deletepracticedevicedetail, headers, data => { StartCoroutine(PostString(Url_Deletepracticedevicedetail, headers, data => {
Debug.Log(data); Debug.Log(data);
})); }));
GameObject Bao = Instantiate(explodePrefab, _transform); GameObject Bao = Instantiate(explodePrefab, _transform);

View File

@ -163,14 +163,14 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
} }
var _unmannedAerialVehicle = unmannedAerialVehicles.FindAll(x => x != null); var _unmannedAerialVehicle = unmannedAerialVehicles.FindAll(x => x != null);
if (_unmannedAerialVehicle==null) if (_unmannedAerialVehicle.Count==0)
{ {
string nowData = string.Format("{0},{1}", "SetToBeDestroyed", equipmentCommon.deviceID); string nowData = string.Format("{0},{1}", "SetToBeDestroyed", equipmentCommon.deviceID);
Debug.Log(nowData); Debug.Log(nowData);
_ = SyncCreateRoom.SendMessageAsync(string.Format("send2room {0}", nowData)); _ = SyncCreateRoom.SendMessageAsync(string.Format("send2room {0}", nowData));
Dictionary<string, string> headers = new Dictionary<string, string>(); WWWForm headers = new WWWForm();
headers.Add("id", equipmentCommon.deviceID); headers.AddField("id", equipmentCommon.deviceID);
StartCoroutine(GetString(Url_Deletepracticedevicedetail, headers, data => { StartCoroutine(PostString(Url_Deletepracticedevicedetail, headers, data => {
Debug.Log(data); Debug.Log(data);
Destroy(gameObject); Destroy(gameObject);
})); }));