This commit is contained in:
账号名 2024-01-19 15:34:33 +08:00
commit 4ff4d87b90
7 changed files with 20 additions and 91 deletions

View File

@ -381,7 +381,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!4 &8245684177115831463
Transform:
m_ObjectHideFlags: 0

View File

@ -140,7 +140,7 @@ public class Microwaveweapon : MonoBehaviour
while (true)
{
yield return new WaitForSeconds(microwtimer);
Debug.LogError("攻击了");
//Debug.LogError("攻击了");
//if (microwtimer>0&&miceopos!=null)
if (miceopos!=null)
{
@ -157,7 +157,7 @@ public class Microwaveweapon : MonoBehaviour
/// <exception cref="NotImplementedException"></exception>
protected string Getmicdata()
{
Debug.Log("上传位置");
//Debug.Log("上传位置");
return string.Format("{0},{1},{2},{3},{4}","Micow", equipment.deviceID, miceopos.transform.position.x,miceopos.transform.position.y,miceopos.transform.position.z);
}

View File

@ -125,12 +125,12 @@ public class DeviceManager : MonoSingleton<DeviceManager>
public void GetSend2roomMsg(string data)
{
data = data.Replace("send2room", "");
Debug.LogError("设备..:" + data);
//Debug.LogError("设备..:" + data);
string[] info = data.Split(',');
foreach (string s in info)
{
Debug.LogError(s);
}
//foreach (string s in info)
//{
// Debug.LogError(s);
//}
if (info.Length < 2) return;
EquipmentCommon equipmentCommon = devices.Find(x => x.deviceID == info[1]);

View File

@ -29,7 +29,7 @@ namespace Assets.Zion.Scripts.Adam
{
if (hitInfo.collider.tag == "WRJ")
{
Debug.Log("daadad");
//Debug.Log("daadad");
currentWRJ = hitInfo.collider.GetComponent<WRJController>();
if (!wRJControllers.Contains(currentWRJ))
wRJControllers.Add(currentWRJ);

View File

@ -301,6 +301,8 @@ public class TerrestrialRadioInterferenceManger : MonoBehaviour
public void Interferencemode()
{
Collider[] colliders = Physics.OverlapSphere(transform.position, detectionRadius * 100);//检索范围
for (int i = 0; i < colliders.Length; i++)
{
if (colliders[i].transform.tag == "WRJ")
@ -315,81 +317,8 @@ public class TerrestrialRadioInterferenceManger : MonoBehaviour
{
unmannedAerialVehicleManage = colliders[i].GetComponent<UnmannedAerialVehicleManage>();
}
if (TransmittedPower == "10~30W" || TransmittedPower == "30~50W" && unmannedAerialVehicleManage != null)
{
Debug.LogError("发射功率进来了1");
Debug.LogError(unmannedAerialVehicleManage.satellitePositioningFrequency);
Debug.LogError(InterferingFrequency);
if (unmannedAerialVehicleManage.satellitePositioningFrequency == InterferingFrequency && unmannedAerialVehicleManage != null)
{
Debug.LogError("相同频率进来了1");
Debug.LogError(InterferenceMode);
Debug.LogError(unmannedAerialVehicleManage != null);
if (InterferenceMode == "驱离" && unmannedAerialVehicleManage != null)
{
Debug.LogError("驱离");
unmannedAerialVehicleManage.transform.DOKill();
unmannedAerialVehicleManage.transform.LookAt(new Vector3(-500, 160, 1600));
unmannedAerialVehicleManage.transform.DOMove(new Vector3(-500, 160, 1600), 60);
}
else if (InterferenceMode == "迫降" && unmannedAerialVehicleManage != null)
{
Debug.LogError("迫降");
unmannedAerialVehicleManage.transform.DOKill();
//unmannedAerialVehicle.transform.DOKill();
//Debug.LogError(unmannedAerialVehicle.name);
RaycastHit hit;
if (Physics.Raycast(unmannedAerialVehicleManage.transform.position, Vector3.down, out hit, Mathf.Infinity, ground))
{
if (hit.distance > 1f)
{
Debug.LogError(hit.distance);
hit.point = new Vector3(hit.point.x, hit.point.y + 3, hit.point.z);
unmannedAerialVehicleManage.transform.DOMove(hit.point, 6);
}
else
{
speed = 0;
}
}
}
}
}
if (TransmittedPower == "50~100W" && unmannedAerialVehicleManage != null)
{
Debug.LogError("功率进来了2");
if (unmannedAerialVehicleManage.dataLinkCommunicationFrequency == InterferingFrequency && unmannedAerialVehicleManage != null)
{
Debug.LogError("频率进来了");
if (unmannedAerialVehicleManage != null)
{
Vector3 one = unmannedAerialVehicleManage.transform.position - transform.position;
float angue = Vector3.Angle(one, transform.forward);
if (float.Parse(InterferenceAngle) >= angue)
{
//unmannedAerialVehicleManage.transform.DOKill();
Debug.LogError("目标出现在范围内");
Debug.LogError(unmannedAerialVehicleManage.maximumFlyingSpeed);
unmannedAerialVehicleManage.maximumFlyingSpeed = (float.Parse(unmannedAerialVehicleManage.maximumFlyingSpeed) - 5).ToString();
Debug.LogError(unmannedAerialVehicleManage.maximumFlyingSpeed);
}
else
{
Debug.LogError("目标没有出现在范围里面");
}
}
}
}
unmannedAerialVehicleManage.CheckSatellitePositioningFrequency(this.transform, InterferenceMode, TransmittedPower, InterferingFrequency, InterferenceAngle, ground);
}
}
}

View File

@ -136,7 +136,7 @@ public class UnmannedAerialVehicle : MonoBehaviour
if (isPassMessage)
{
string nowData = GetSyncDis();
Debug.Log(nowData);
//Debug.Log(nowData);
//_ = SyncCreateRoom.SendMessageAsync(string.Format("send2room {0}", nowData));
DeviceManager.Instance.send2roomStr.Enqueue(nowData);
string currentTime = System.DateTime.Now.ToString();
@ -183,7 +183,7 @@ public class UnmannedAerialVehicle : MonoBehaviour
{
EquipmentCommon _equipmentCommon = _transform.GetComponent<EquipmentCommon>();
string nowData = string.Format("{0},{1}", "SetToBeDestroyed", _equipmentCommon.deviceID);
Debug.Log(nowData);
//Debug.Log(nowData);
_ = SyncCreateRoom.SendMessageAsync(string.Format("send2room {0}", nowData));
string currentTime = System.DateTime.Now.ToString();
string _log = currentTime + " " + unmannedAerialVehicleManage.equipmentCommon.equipmentType + "(" + unmannedAerialVehicleManage.equipmentCommon.deviceID + ")"
@ -192,9 +192,9 @@ public class UnmannedAerialVehicle : MonoBehaviour
WWWForm headers = new WWWForm();
headers.AddField("id", _equipmentCommon.deviceID);
StartCoroutine(PostString(Url_Deletepracticedevicedetail, headers, data => {
Debug.Log(data);
}));
//StartCoroutine(PostString(Url_Deletepracticedevicedetail, headers, data => {
// //Debug.Log(data);
//}));
GameObject Bao = Instantiate(explodePrefab, _transform);
Bao.transform.localPosition = Vector3.zero;
Bao.transform.SetParent(null);

View File

@ -192,14 +192,14 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
if (_unmannedAerialVehicle.Count == 0)
{
string nowData = string.Format("{0},{1}", "SetToBeDestroyed", equipmentCommon.deviceID);
Debug.Log(nowData);
//Debug.Log(nowData);
_ = SyncCreateRoom.SendMessageAsync(string.Format("send2room {0}", nowData));
UploadLog(equipmentCommon.deviceID);
WWWForm headers = new WWWForm();
headers.AddField("id", equipmentCommon.deviceID);
StartCoroutine(PostString(Url_Deletepracticedevicedetail, headers, data =>
{
Debug.Log(data);
//Debug.Log(data);
Destroy(gameObject);
}));
}
@ -222,7 +222,7 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
string uploadLogMainJson = JsonConvert.SerializeObject(uploadLogMains);
WWWForm wWWForm = new WWWForm();
wWWForm.AddField("data", uploadLogMainJson);
Debug.Log(uploadLogMainJson);
//Debug.Log(uploadLogMainJson);
StartCoroutine(PostString(Url_Addpracticelog, wWWForm, data =>
{
Debug.Log(data);