Merge branch 'master' of http://git.umayle.com:2023/yulong/NewN_UAVPlane
This commit is contained in:
commit
4ff4d87b90
|
@ -381,7 +381,7 @@ GameObject:
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
m_StaticEditorFlags: 0
|
m_StaticEditorFlags: 0
|
||||||
m_IsActive: 1
|
m_IsActive: 0
|
||||||
--- !u!4 &8245684177115831463
|
--- !u!4 &8245684177115831463
|
||||||
Transform:
|
Transform:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
@ -140,7 +140,7 @@ public class Microwaveweapon : MonoBehaviour
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
yield return new WaitForSeconds(microwtimer);
|
yield return new WaitForSeconds(microwtimer);
|
||||||
Debug.LogError("攻击了");
|
//Debug.LogError("攻击了");
|
||||||
//if (microwtimer>0&&miceopos!=null)
|
//if (microwtimer>0&&miceopos!=null)
|
||||||
if (miceopos!=null)
|
if (miceopos!=null)
|
||||||
{
|
{
|
||||||
|
@ -157,7 +157,7 @@ public class Microwaveweapon : MonoBehaviour
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
protected string Getmicdata()
|
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);
|
return string.Format("{0},{1},{2},{3},{4}","Micow", equipment.deviceID, miceopos.transform.position.x,miceopos.transform.position.y,miceopos.transform.position.z);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -125,12 +125,12 @@ public class DeviceManager : MonoSingleton<DeviceManager>
|
||||||
public void GetSend2roomMsg(string data)
|
public void GetSend2roomMsg(string data)
|
||||||
{
|
{
|
||||||
data = data.Replace("send2room", "");
|
data = data.Replace("send2room", "");
|
||||||
Debug.LogError("设备..:" + data);
|
//Debug.LogError("设备..:" + data);
|
||||||
string[] info = data.Split(',');
|
string[] info = data.Split(',');
|
||||||
foreach (string s in info)
|
//foreach (string s in info)
|
||||||
{
|
//{
|
||||||
Debug.LogError(s);
|
// Debug.LogError(s);
|
||||||
}
|
//}
|
||||||
if (info.Length < 2) return;
|
if (info.Length < 2) return;
|
||||||
|
|
||||||
EquipmentCommon equipmentCommon = devices.Find(x => x.deviceID == info[1]);
|
EquipmentCommon equipmentCommon = devices.Find(x => x.deviceID == info[1]);
|
||||||
|
|
|
@ -29,7 +29,7 @@ namespace Assets.Zion.Scripts.Adam
|
||||||
{
|
{
|
||||||
if (hitInfo.collider.tag == "WRJ")
|
if (hitInfo.collider.tag == "WRJ")
|
||||||
{
|
{
|
||||||
Debug.Log("daadad");
|
//Debug.Log("daadad");
|
||||||
currentWRJ = hitInfo.collider.GetComponent<WRJController>();
|
currentWRJ = hitInfo.collider.GetComponent<WRJController>();
|
||||||
if (!wRJControllers.Contains(currentWRJ))
|
if (!wRJControllers.Contains(currentWRJ))
|
||||||
wRJControllers.Add(currentWRJ);
|
wRJControllers.Add(currentWRJ);
|
||||||
|
|
|
@ -301,6 +301,8 @@ public class TerrestrialRadioInterferenceManger : MonoBehaviour
|
||||||
public void Interferencemode()
|
public void Interferencemode()
|
||||||
{
|
{
|
||||||
Collider[] colliders = Physics.OverlapSphere(transform.position, detectionRadius * 100);//检索范围
|
Collider[] colliders = Physics.OverlapSphere(transform.position, detectionRadius * 100);//检索范围
|
||||||
|
|
||||||
|
|
||||||
for (int i = 0; i < colliders.Length; i++)
|
for (int i = 0; i < colliders.Length; i++)
|
||||||
{
|
{
|
||||||
if (colliders[i].transform.tag == "WRJ")
|
if (colliders[i].transform.tag == "WRJ")
|
||||||
|
@ -315,81 +317,8 @@ public class TerrestrialRadioInterferenceManger : MonoBehaviour
|
||||||
{
|
{
|
||||||
unmannedAerialVehicleManage = colliders[i].GetComponent<UnmannedAerialVehicleManage>();
|
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)
|
unmannedAerialVehicleManage.CheckSatellitePositioningFrequency(this.transform, InterferenceMode, TransmittedPower, InterferingFrequency, InterferenceAngle, ground);
|
||||||
{
|
|
||||||
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("目标没有出现在范围里面");
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -136,7 +136,7 @@ public class UnmannedAerialVehicle : MonoBehaviour
|
||||||
if (isPassMessage)
|
if (isPassMessage)
|
||||||
{
|
{
|
||||||
string nowData = GetSyncDis();
|
string nowData = GetSyncDis();
|
||||||
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);
|
DeviceManager.Instance.send2roomStr.Enqueue(nowData);
|
||||||
string currentTime = System.DateTime.Now.ToString();
|
string currentTime = System.DateTime.Now.ToString();
|
||||||
|
@ -183,7 +183,7 @@ public class UnmannedAerialVehicle : MonoBehaviour
|
||||||
{
|
{
|
||||||
EquipmentCommon _equipmentCommon = _transform.GetComponent<EquipmentCommon>();
|
EquipmentCommon _equipmentCommon = _transform.GetComponent<EquipmentCommon>();
|
||||||
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));
|
||||||
string currentTime = System.DateTime.Now.ToString();
|
string currentTime = System.DateTime.Now.ToString();
|
||||||
string _log = currentTime + " " + unmannedAerialVehicleManage.equipmentCommon.equipmentType + "(" + unmannedAerialVehicleManage.equipmentCommon.deviceID + ")"
|
string _log = currentTime + " " + unmannedAerialVehicleManage.equipmentCommon.equipmentType + "(" + unmannedAerialVehicleManage.equipmentCommon.deviceID + ")"
|
||||||
|
@ -192,9 +192,9 @@ public class UnmannedAerialVehicle : MonoBehaviour
|
||||||
|
|
||||||
WWWForm headers = new WWWForm();
|
WWWForm headers = new WWWForm();
|
||||||
headers.AddField("id", _equipmentCommon.deviceID);
|
headers.AddField("id", _equipmentCommon.deviceID);
|
||||||
StartCoroutine(PostString(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);
|
||||||
Bao.transform.localPosition = Vector3.zero;
|
Bao.transform.localPosition = Vector3.zero;
|
||||||
Bao.transform.SetParent(null);
|
Bao.transform.SetParent(null);
|
||||||
|
|
|
@ -192,14 +192,14 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
||||||
if (_unmannedAerialVehicle.Count == 0)
|
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));
|
||||||
UploadLog(equipmentCommon.deviceID);
|
UploadLog(equipmentCommon.deviceID);
|
||||||
WWWForm headers = new WWWForm();
|
WWWForm headers = new WWWForm();
|
||||||
headers.AddField("id", equipmentCommon.deviceID);
|
headers.AddField("id", equipmentCommon.deviceID);
|
||||||
StartCoroutine(PostString(Url_Deletepracticedevicedetail, headers, data =>
|
StartCoroutine(PostString(Url_Deletepracticedevicedetail, headers, data =>
|
||||||
{
|
{
|
||||||
Debug.Log(data);
|
//Debug.Log(data);
|
||||||
Destroy(gameObject);
|
Destroy(gameObject);
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
@ -222,7 +222,7 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
||||||
string uploadLogMainJson = JsonConvert.SerializeObject(uploadLogMains);
|
string uploadLogMainJson = JsonConvert.SerializeObject(uploadLogMains);
|
||||||
WWWForm wWWForm = new WWWForm();
|
WWWForm wWWForm = new WWWForm();
|
||||||
wWWForm.AddField("data", uploadLogMainJson);
|
wWWForm.AddField("data", uploadLogMainJson);
|
||||||
Debug.Log(uploadLogMainJson);
|
//Debug.Log(uploadLogMainJson);
|
||||||
StartCoroutine(PostString(Url_Addpracticelog, wWWForm, data =>
|
StartCoroutine(PostString(Url_Addpracticelog, wWWForm, data =>
|
||||||
{
|
{
|
||||||
Debug.Log(data);
|
Debug.Log(data);
|
||||||
|
|
Loading…
Reference in New Issue