This commit is contained in:
YangHua 2024-01-23 13:08:13 +08:00
commit af6c663b98
2 changed files with 3 additions and 1 deletions

View File

@ -262,6 +262,7 @@ public class EquipmentCommon : MonoBehaviour
} }
break; break;
case "SingleDronePosition"://无人机攻击目标锁定 case "SingleDronePosition"://无人机攻击目标锁定
Debug.Log("接受...:"+data[0] +","+ data[1] + "," + data[2] + "," + data[3] + "," + data[4]);
UnmannedAerialVehicleManage unmannedAerialVehicleManage = GetComponent<UnmannedAerialVehicleManage>(); UnmannedAerialVehicleManage unmannedAerialVehicleManage = GetComponent<UnmannedAerialVehicleManage>();
if (unmannedAerialVehicleManage&& unmannedAerialVehicleManage.wrjModel== WRJModel.) if (unmannedAerialVehicleManage&& unmannedAerialVehicleManage.wrjModel== WRJModel.)
{ {

View File

@ -232,7 +232,8 @@ public class UnmannedAerialVehicle : MonoBehaviour
{ {
string nowData = GetSyncData(attackTarget); string nowData = GetSyncData(attackTarget);
Debug.Log(nowData); Debug.Log(nowData);
_ = SyncCreateRoom.SendMessageAsync(string.Format("send2room {0}", nowData)); //_ = SyncCreateRoom.SendMessageAsync(string.Format("send2room {0}", nowData));
DeviceManager.Instance.send2roomStr.Enqueue(nowData);
float distance = Vector3.Distance(transform.position, attackTarget.position); float distance = Vector3.Distance(transform.position, attackTarget.position);
transform.DOMove(attackTarget.position, distance / FireSpeed).SetEase(Ease.Linear).OnComplete(() => transform.DOMove(attackTarget.position, distance / FireSpeed).SetEase(Ease.Linear).OnComplete(() =>
{ {