Merge branch 'master' of http://git.umayle.com:2023/yulong/NewN_UAVPlane
This commit is contained in:
commit
77de3a1607
|
@ -1626,8 +1626,6 @@ MonoBehaviour:
|
||||||
SurveillanceFrequencyBand: {fileID: 8129871292636694301}
|
SurveillanceFrequencyBand: {fileID: 8129871292636694301}
|
||||||
flySpeedPlane: {fileID: 9020723963205404446}
|
flySpeedPlane: {fileID: 9020723963205404446}
|
||||||
flySpeedSlider: {fileID: 608716198515631330}
|
flySpeedSlider: {fileID: 608716198515631330}
|
||||||
gamePos: {fileID: 3441049289142467652}
|
|
||||||
gamemap: {fileID: 9017854076308260405}
|
|
||||||
reveal: 0
|
reveal: 0
|
||||||
Ground:
|
Ground:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
|
@ -2798,14 +2796,13 @@ PrefabInstance:
|
||||||
propertyPath: m_Layer
|
propertyPath: m_Layer
|
||||||
value: 15
|
value: 15
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 8500934962979638684, guid: 91b685a7f0a6f7643b8ae61842f883de,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_IsActive
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
m_RemovedComponents: []
|
m_RemovedComponents: []
|
||||||
m_SourcePrefab: {fileID: 100100000, guid: 91b685a7f0a6f7643b8ae61842f883de, type: 3}
|
m_SourcePrefab: {fileID: 100100000, guid: 91b685a7f0a6f7643b8ae61842f883de, type: 3}
|
||||||
--- !u!1 &9017854076308260405 stripped
|
|
||||||
GameObject:
|
|
||||||
m_CorrespondingSourceObject: {fileID: 8500934962979638684, guid: 91b685a7f0a6f7643b8ae61842f883de,
|
|
||||||
type: 3}
|
|
||||||
m_PrefabInstance: {fileID: 638589549675547561}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
--- !u!4 &5172610439169658982 stripped
|
--- !u!4 &5172610439169658982 stripped
|
||||||
Transform:
|
Transform:
|
||||||
m_CorrespondingSourceObject: {fileID: 5698306997877693391, guid: 91b685a7f0a6f7643b8ae61842f883de,
|
m_CorrespondingSourceObject: {fileID: 5698306997877693391, guid: 91b685a7f0a6f7643b8ae61842f883de,
|
||||||
|
@ -3067,6 +3064,11 @@ PrefabInstance:
|
||||||
propertyPath: m_Layer
|
propertyPath: m_Layer
|
||||||
value: 16
|
value: 16
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 8500934962979638684, guid: 91b685a7f0a6f7643b8ae61842f883de,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_IsActive
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
m_RemovedComponents: []
|
m_RemovedComponents: []
|
||||||
m_SourcePrefab: {fileID: 100100000, guid: 91b685a7f0a6f7643b8ae61842f883de, type: 3}
|
m_SourcePrefab: {fileID: 100100000, guid: 91b685a7f0a6f7643b8ae61842f883de, type: 3}
|
||||||
--- !u!4 &1525602421726030359 stripped
|
--- !u!4 &1525602421726030359 stripped
|
||||||
|
@ -3075,12 +3077,6 @@ Transform:
|
||||||
type: 3}
|
type: 3}
|
||||||
m_PrefabInstance: {fileID: 6501072882878902744}
|
m_PrefabInstance: {fileID: 6501072882878902744}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
--- !u!1 &3441049289142467652 stripped
|
|
||||||
GameObject:
|
|
||||||
m_CorrespondingSourceObject: {fileID: 8500934962979638684, guid: 91b685a7f0a6f7643b8ae61842f883de,
|
|
||||||
type: 3}
|
|
||||||
m_PrefabInstance: {fileID: 6501072882878902744}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
--- !u!1001 &6738463286047272674
|
--- !u!1001 &6738463286047272674
|
||||||
PrefabInstance:
|
PrefabInstance:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
@ -3542,9 +3538,9 @@ PrefabInstance:
|
||||||
- {fileID: 5839716182141322363, guid: 38fb1def99b2cd147a96842efe5a355b, type: 3}
|
- {fileID: 5839716182141322363, guid: 38fb1def99b2cd147a96842efe5a355b, type: 3}
|
||||||
- {fileID: 2022963561981901188, guid: 38fb1def99b2cd147a96842efe5a355b, type: 3}
|
- {fileID: 2022963561981901188, guid: 38fb1def99b2cd147a96842efe5a355b, type: 3}
|
||||||
m_SourcePrefab: {fileID: 100100000, guid: 38fb1def99b2cd147a96842efe5a355b, type: 3}
|
m_SourcePrefab: {fileID: 100100000, guid: 38fb1def99b2cd147a96842efe5a355b, type: 3}
|
||||||
--- !u!114 &1189649587738053663 stripped
|
--- !u!114 &7739009189435305960 stripped
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_CorrespondingSourceObject: {fileID: 5548909004573041405, guid: 38fb1def99b2cd147a96842efe5a355b,
|
m_CorrespondingSourceObject: {fileID: 3955760755921223946, guid: 38fb1def99b2cd147a96842efe5a355b,
|
||||||
type: 3}
|
type: 3}
|
||||||
m_PrefabInstance: {fileID: 6738463286047272674}
|
m_PrefabInstance: {fileID: 6738463286047272674}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
@ -3566,9 +3562,9 @@ MonoBehaviour:
|
||||||
m_Script: {fileID: 11500000, guid: 9085046f02f69544eb97fd06b6048fe2, type: 3}
|
m_Script: {fileID: 11500000, guid: 9085046f02f69544eb97fd06b6048fe2, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
--- !u!114 &805817557573538235 stripped
|
--- !u!114 &6599785080451423720 stripped
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_CorrespondingSourceObject: {fileID: 6245650889842523993, guid: 38fb1def99b2cd147a96842efe5a355b,
|
m_CorrespondingSourceObject: {fileID: 438240288241169162, guid: 38fb1def99b2cd147a96842efe5a355b,
|
||||||
type: 3}
|
type: 3}
|
||||||
m_PrefabInstance: {fileID: 6738463286047272674}
|
m_PrefabInstance: {fileID: 6738463286047272674}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
@ -3596,9 +3592,9 @@ GameObject:
|
||||||
type: 3}
|
type: 3}
|
||||||
m_PrefabInstance: {fileID: 6738463286047272674}
|
m_PrefabInstance: {fileID: 6738463286047272674}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
--- !u!114 &6599785080451423720 stripped
|
--- !u!114 &1189649587738053663 stripped
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_CorrespondingSourceObject: {fileID: 438240288241169162, guid: 38fb1def99b2cd147a96842efe5a355b,
|
m_CorrespondingSourceObject: {fileID: 5548909004573041405, guid: 38fb1def99b2cd147a96842efe5a355b,
|
||||||
type: 3}
|
type: 3}
|
||||||
m_PrefabInstance: {fileID: 6738463286047272674}
|
m_PrefabInstance: {fileID: 6738463286047272674}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
@ -3632,9 +3628,9 @@ MonoBehaviour:
|
||||||
m_Script: {fileID: 11500000, guid: 9085046f02f69544eb97fd06b6048fe2, type: 3}
|
m_Script: {fileID: 11500000, guid: 9085046f02f69544eb97fd06b6048fe2, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
--- !u!114 &7739009189435305960 stripped
|
--- !u!114 &805817557573538235 stripped
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_CorrespondingSourceObject: {fileID: 3955760755921223946, guid: 38fb1def99b2cd147a96842efe5a355b,
|
m_CorrespondingSourceObject: {fileID: 6245650889842523993, guid: 38fb1def99b2cd147a96842efe5a355b,
|
||||||
type: 3}
|
type: 3}
|
||||||
m_PrefabInstance: {fileID: 6738463286047272674}
|
m_PrefabInstance: {fileID: 6738463286047272674}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
@ -4100,6 +4096,18 @@ PrefabInstance:
|
||||||
- {fileID: 5839716182141322363, guid: 38fb1def99b2cd147a96842efe5a355b, type: 3}
|
- {fileID: 5839716182141322363, guid: 38fb1def99b2cd147a96842efe5a355b, type: 3}
|
||||||
- {fileID: 2022963561981901188, guid: 38fb1def99b2cd147a96842efe5a355b, type: 3}
|
- {fileID: 2022963561981901188, guid: 38fb1def99b2cd147a96842efe5a355b, type: 3}
|
||||||
m_SourcePrefab: {fileID: 100100000, guid: 38fb1def99b2cd147a96842efe5a355b, type: 3}
|
m_SourcePrefab: {fileID: 100100000, guid: 38fb1def99b2cd147a96842efe5a355b, type: 3}
|
||||||
|
--- !u!114 &3114167497287670592 stripped
|
||||||
|
MonoBehaviour:
|
||||||
|
m_CorrespondingSourceObject: {fileID: 5548909004573041405, guid: 38fb1def99b2cd147a96842efe5a355b,
|
||||||
|
type: 3}
|
||||||
|
m_PrefabInstance: {fileID: 7365093489755617725}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 0}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 9085046f02f69544eb97fd06b6048fe2, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
--- !u!114 &8959769708417747035 stripped
|
--- !u!114 &8959769708417747035 stripped
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_CorrespondingSourceObject: {fileID: 1900922108148937190, guid: 38fb1def99b2cd147a96842efe5a355b,
|
m_CorrespondingSourceObject: {fileID: 1900922108148937190, guid: 38fb1def99b2cd147a96842efe5a355b,
|
||||||
|
@ -4190,15 +4198,3 @@ GameObject:
|
||||||
type: 3}
|
type: 3}
|
||||||
m_PrefabInstance: {fileID: 7365093489755617725}
|
m_PrefabInstance: {fileID: 7365093489755617725}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
--- !u!114 &3114167497287670592 stripped
|
|
||||||
MonoBehaviour:
|
|
||||||
m_CorrespondingSourceObject: {fileID: 5548909004573041405, guid: 38fb1def99b2cd147a96842efe5a355b,
|
|
||||||
type: 3}
|
|
||||||
m_PrefabInstance: {fileID: 7365093489755617725}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 0}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_EditorHideFlags: 0
|
|
||||||
m_Script: {fileID: 11500000, guid: 9085046f02f69544eb97fd06b6048fe2, type: 3}
|
|
||||||
m_Name:
|
|
||||||
m_EditorClassIdentifier:
|
|
||||||
|
|
|
@ -165,7 +165,7 @@ public class RadarManger : MonoBehaviour
|
||||||
if (isStartRehearsing)
|
if (isStartRehearsing)
|
||||||
{
|
{
|
||||||
minCamera.gameObject.SetActive(true);
|
minCamera.gameObject.SetActive(true);
|
||||||
targets = GameObject.FindGameObjectsWithTag("WRJ").ToList().FindAll(a => a.GetComponent<UnmannedAerialVehicleManage>().GetRCS() > rcs);
|
targets = GameObject.FindGameObjectsWithTag("WRJ").ToList().FindAll(GetQualifiedEquipment);
|
||||||
|
|
||||||
foreach (Transform child in rawImage.transform)
|
foreach (Transform child in rawImage.transform)
|
||||||
{
|
{
|
||||||
|
@ -187,30 +187,14 @@ public class RadarManger : MonoBehaviour
|
||||||
// onlyOne = false;
|
// onlyOne = false;
|
||||||
// DroneViewDisplay.Instance.CreateUI(equipmentCommon.deviceID, minCamera, rawImage);
|
// DroneViewDisplay.Instance.CreateUI(equipmentCommon.deviceID, minCamera, rawImage);
|
||||||
//}
|
//}
|
||||||
Deadzone();//雷达盲区
|
//Deadzone();//雷达盲区
|
||||||
//if (Mapsize >1)
|
//if (Mapsize >1)
|
||||||
//{
|
//{
|
||||||
// Dotsize();//改变雷达地图上显示无人机大小
|
// Dotsize();//改变雷达地图上显示无人机大小
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Dotsize()
|
|
||||||
{
|
|
||||||
GameObject[] wrjdtdx = GameObject.FindGameObjectsWithTag("WRJ");
|
|
||||||
for (int i = 0; i < wrjdtdx.Length; i++)
|
|
||||||
{
|
|
||||||
if (wrjdtdx[i].gameObject.tag == "WRJ" && equipmentCommon.isPlayer)
|
|
||||||
{
|
|
||||||
UnmannedAerialVehicleManage unmannedAerialVehicleManage = wrjdtdx[i].GetComponent<UnmannedAerialVehicleManage>();
|
|
||||||
if (unmannedAerialVehicleManage && unmannedAerialVehicleManage.gamemap)
|
|
||||||
{
|
|
||||||
unmannedAerialVehicleManage.gamemap.transform.localScale = new Vector3(Mapsize, 1, Mapsize);
|
|
||||||
//Debug.Log("改变了无人机显示大小");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#region 启动暂停
|
#region 启动暂停
|
||||||
|
@ -270,13 +254,6 @@ public class RadarManger : MonoBehaviour
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
void CreateRadarUI()
|
|
||||||
{
|
|
||||||
imageprs.transform.localScale = Vector3.zero;
|
|
||||||
aniRandarUI = imageprs.GetComponent<Animator>();
|
|
||||||
RadarRotationSpeed(TurntableSpeed);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 数据写入
|
/// 数据写入
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -289,11 +266,11 @@ public class RadarManger : MonoBehaviour
|
||||||
{
|
{
|
||||||
case "转台转速:":
|
case "转台转速:":
|
||||||
TurntableSpeed = weaponitemone[i].para_value;
|
TurntableSpeed = weaponitemone[i].para_value;
|
||||||
//RadarRotationSpeed(TurntableSpeed);
|
RadarRotationSpeed(TurntableSpeed);
|
||||||
break;
|
break;
|
||||||
case "探测距离:":
|
case "探测距离:":
|
||||||
DetectionRange = weaponitemone[i].para_value;
|
DetectionRange = weaponitemone[i].para_value;
|
||||||
Showmap(float.Parse(DetectionRange));
|
//Showmap(float.Parse(DetectionRange));
|
||||||
detectionRadius = float.Parse(DetectionRange) * 1000;
|
detectionRadius = float.Parse(DetectionRange) * 1000;
|
||||||
minCamera.orthographicSize = detectionRadius;
|
minCamera.orthographicSize = detectionRadius;
|
||||||
break;
|
break;
|
||||||
|
@ -330,29 +307,7 @@ public class RadarManger : MonoBehaviour
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Showmap(float size)
|
|
||||||
{
|
|
||||||
switch (size)
|
|
||||||
{
|
|
||||||
case 1:
|
|
||||||
Mapsize = 30;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
Mapsize = 60;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
Mapsize = 90;
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
Mapsize = 120;
|
|
||||||
break;
|
|
||||||
case 5:
|
|
||||||
Mapsize = 150;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 雷达转动速度
|
/// 雷达转动速度
|
||||||
|
@ -371,28 +326,21 @@ public class RadarManger : MonoBehaviour
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Collider> colliders = new List<Collider>();
|
|
||||||
|
|
||||||
public List<Collider> attackColliders1 = new List<Collider>();
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 检索
|
/// 检索
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void RetrievalUAV()
|
public void RetrievalUAV()
|
||||||
{
|
{
|
||||||
colliders = Physics.OverlapSphere(transform.position, detectionRadius).ToList(); // 检索范围内的所有碰撞体
|
if (targets.Count > 0)
|
||||||
var colliders2 = colliders.FindAll(x => x.tag == "WRJ");
|
|
||||||
|
|
||||||
if (colliders2.Count > 0)
|
|
||||||
{
|
{
|
||||||
for (int i = 0; i < colliders2.Count; i++)
|
for (int i = 0; i < targets.Count; i++)
|
||||||
{
|
{
|
||||||
UnmannedAerialVehicle unmannedAerialVehicle = colliders2[i].GetComponent<UnmannedAerialVehicle>();
|
UnmannedAerialVehicle unmannedAerialVehicle = targets[i].GetComponent<UnmannedAerialVehicle>();
|
||||||
if (unmannedAerialVehicle)
|
if (unmannedAerialVehicle)
|
||||||
{
|
{
|
||||||
bool isnearBlindArea = Vector3.Distance(transform.position, unmannedAerialVehicle.transform.position) > nearBlindArea;
|
bool isnearBlindArea = Vector3.Distance(transform.position, unmannedAerialVehicle.transform.position) > nearBlindArea;
|
||||||
if (!isnearBlindArea)
|
if (!isnearBlindArea)
|
||||||
continue;
|
continue;
|
||||||
attackColliders1.Add(colliders[i]);
|
|
||||||
LaserFireControlPlatformManger laserFireControlPlatformManger = LaserFireControlPlatformManger.laserFireControlPlatformMangers.Find(x => (x != null && x.isLasing == false && x.lasertime <= 0));
|
LaserFireControlPlatformManger laserFireControlPlatformManger = LaserFireControlPlatformManger.laserFireControlPlatformMangers.Find(x => (x != null && x.isLasing == false && x.lasertime <= 0));
|
||||||
Microwaveweapon microwaveweapon = Microwaveweapon.MicrowaveweaponList.Find(x => x != null && x.ismicow == false);
|
Microwaveweapon microwaveweapon = Microwaveweapon.MicrowaveweaponList.Find(x => x != null && x.ismicow == false);
|
||||||
if (laserFireControlPlatformManger)
|
if (laserFireControlPlatformManger)
|
||||||
|
@ -412,28 +360,132 @@ public class RadarManger : MonoBehaviour
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#region 备份
|
||||||
|
// public List<Collider> colliders = new List<Collider>();
|
||||||
|
// public List<Collider> attackColliders1 = new List<Collider>();
|
||||||
|
//public void RetrievalUAV()
|
||||||
|
//{
|
||||||
|
// colliders = Physics.OverlapSphere(transform.position, detectionRadius).ToList(); // 检索范围内的所有碰撞体
|
||||||
|
// var colliders2 = colliders.FindAll(x => x.tag == "WRJ");
|
||||||
|
|
||||||
|
// if (colliders2.Count > 0)
|
||||||
|
// {
|
||||||
|
// for (int i = 0; i < colliders2.Count; i++)
|
||||||
|
// {
|
||||||
|
// UnmannedAerialVehicle unmannedAerialVehicle = colliders2[i].GetComponent<UnmannedAerialVehicle>();
|
||||||
|
// if (unmannedAerialVehicle)
|
||||||
|
// {
|
||||||
|
// bool isnearBlindArea = Vector3.Distance(transform.position, unmannedAerialVehicle.transform.position) > nearBlindArea;
|
||||||
|
// if (!isnearBlindArea)
|
||||||
|
// continue;
|
||||||
|
// attackColliders1.Add(colliders[i]);
|
||||||
|
// LaserFireControlPlatformManger laserFireControlPlatformManger = LaserFireControlPlatformManger.laserFireControlPlatformMangers.Find(x => (x != null && x.isLasing == false && x.lasertime <= 0));
|
||||||
|
// Microwaveweapon microwaveweapon = Microwaveweapon.MicrowaveweaponList.Find(x => x != null && x.ismicow == false);
|
||||||
|
// if (laserFireControlPlatformManger)
|
||||||
|
// {
|
||||||
|
// laserFireControlPlatformManger.lasertime = laserFireControlPlatformManger.storageIntervalTime + 1.5f;
|
||||||
|
// laserFireControlPlatformManger.isLasing = true;
|
||||||
|
// laserFireControlPlatformManger.targetPoint = unmannedAerialVehicle.transform;
|
||||||
|
// laserFireControlPlatformManger.Lasing();
|
||||||
|
// }
|
||||||
|
// else if (microwaveweapon)
|
||||||
|
// {
|
||||||
|
// microwaveweapon.ismicow = true;
|
||||||
|
// microwaveweapon.miceopos = unmannedAerialVehicle.transform;
|
||||||
|
// microwaveweapon.Orientation();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
//private void Showmap(float size)
|
||||||
|
//{
|
||||||
|
// switch (size)
|
||||||
|
// {
|
||||||
|
// case 1:
|
||||||
|
// Mapsize = 30;
|
||||||
|
// break;
|
||||||
|
// case 2:
|
||||||
|
// Mapsize = 60;
|
||||||
|
// break;
|
||||||
|
// case 3:
|
||||||
|
// Mapsize = 90;
|
||||||
|
// break;
|
||||||
|
// case 4:
|
||||||
|
// Mapsize = 120;
|
||||||
|
// break;
|
||||||
|
// case 5:
|
||||||
|
// Mapsize = 150;
|
||||||
|
// break;
|
||||||
|
// default:
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
//void CreateRadarUI()
|
||||||
|
//{
|
||||||
|
// imageprs.transform.localScale = Vector3.zero;
|
||||||
|
// aniRandarUI = imageprs.GetComponent<Animator>();
|
||||||
|
// RadarRotationSpeed(TurntableSpeed);
|
||||||
|
//}
|
||||||
|
|
||||||
|
//private void Dotsize()
|
||||||
|
//{
|
||||||
|
// GameObject[] wrjdtdx = GameObject.FindGameObjectsWithTag("WRJ");
|
||||||
|
// for (int i = 0; i < wrjdtdx.Length; i++)
|
||||||
|
// {
|
||||||
|
// if (wrjdtdx[i].gameObject.tag == "WRJ" && equipmentCommon.isPlayer)
|
||||||
|
// {
|
||||||
|
// UnmannedAerialVehicleManage unmannedAerialVehicleManage = wrjdtdx[i].GetComponent<UnmannedAerialVehicleManage>();
|
||||||
|
// if (unmannedAerialVehicleManage && unmannedAerialVehicleManage.gamemap)
|
||||||
|
// {
|
||||||
|
// unmannedAerialVehicleManage.gamemap.transform.localScale = new Vector3(Mapsize, 1, Mapsize);
|
||||||
|
// //Debug.Log("改变了无人机显示大小");
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
//}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 雷达盲区让目标消失在地图上
|
/// 雷达盲区让目标消失在地图上
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void Deadzone()
|
//private void Deadzone()
|
||||||
|
//{
|
||||||
|
// if (float.Parse(NearBlindArea) > 0)
|
||||||
|
// {
|
||||||
|
// Collider[] colliders = Physics.OverlapSphere(transform.position, float.Parse(NearBlindArea));
|
||||||
|
// for (int i = 0; i < colliders.Length; i++)
|
||||||
|
// {
|
||||||
|
// if (colliders[i].transform.gameObject.tag == "WRJ")
|
||||||
|
// {
|
||||||
|
// //Debug.Log("进来了" + Vector3.Distance(transform.position, colliders[i].transform.position));
|
||||||
|
// UnmannedAerialVehicleManage unmannedAerialVehicle = colliders[i].GetComponent<UnmannedAerialVehicleManage>();
|
||||||
|
// if (unmannedAerialVehicle)
|
||||||
|
// {
|
||||||
|
// unmannedAerialVehicle.gamemap.SetActive(false);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取符合条件的设备
|
||||||
|
/// </summary>
|
||||||
|
public bool GetQualifiedEquipment(GameObject obj)
|
||||||
{
|
{
|
||||||
if (float.Parse(NearBlindArea) > 0)
|
if(obj.GetComponent<UnmannedAerialVehicleManage>()
|
||||||
{
|
&& obj.GetComponent<UnmannedAerialVehicleManage>().GetRCS() > rcs
|
||||||
Collider[] colliders = Physics.OverlapSphere(transform.position, float.Parse(NearBlindArea));
|
&& Vector3.Distance(transform.position,obj.transform.position)> float.Parse(NearBlindArea))
|
||||||
for (int i = 0; i < colliders.Length; i++)
|
return true;
|
||||||
{
|
else
|
||||||
if (colliders[i].transform.gameObject.tag == "WRJ")
|
return false;
|
||||||
{
|
|
||||||
//Debug.Log("进来了" + Vector3.Distance(transform.position, colliders[i].transform.position));
|
|
||||||
UnmannedAerialVehicleManage unmannedAerialVehicle = colliders[i].GetComponent<UnmannedAerialVehicleManage>();
|
|
||||||
if (unmannedAerialVehicle)
|
|
||||||
{
|
|
||||||
unmannedAerialVehicle.gamemap.SetActive(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 检测鼠标点击的方法
|
/// 检测鼠标点击的方法
|
||||||
|
|
|
@ -184,14 +184,14 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ExtendedSlider flySpeedSlider;
|
public ExtendedSlider flySpeedSlider;
|
||||||
|
|
||||||
/// <summary>
|
///// <summary>
|
||||||
/// 显示频谱地图上的位置
|
///// 显示频谱地图上的位置
|
||||||
/// </summary>
|
///// </summary>
|
||||||
public GameObject gamePos;
|
//public GameObject gamePos;
|
||||||
/// <summary>
|
///// <summary>
|
||||||
/// 显示在雷达上的位置
|
///// 显示在雷达上的位置
|
||||||
/// </summary>
|
///// </summary>
|
||||||
public GameObject gamemap;
|
//public GameObject gamemap;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 频谱显示无人机大小
|
/// 频谱显示无人机大小
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -206,7 +206,7 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
||||||
public bool boisp = true;
|
public bool boisp = true;
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
gamePos.gameObject.SetActive(false);
|
//gamePos.gameObject.SetActive(false);
|
||||||
MatrixFormation(30, 1);
|
MatrixFormation(30, 1);
|
||||||
for (int i = 0; i < unmannedAerialVehicles.Count; i++)
|
for (int i = 0; i < unmannedAerialVehicles.Count; i++)
|
||||||
{
|
{
|
||||||
|
@ -231,14 +231,14 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
||||||
flySpeedSlider.DragStop.AddListener(ChanagerFlySpeed);
|
flySpeedSlider.DragStop.AddListener(ChanagerFlySpeed);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Mapdisplay()
|
//private void Mapdisplay()
|
||||||
{
|
//{
|
||||||
if (reveal > 1)
|
// if (reveal > 1)
|
||||||
{
|
// {
|
||||||
gamePos.transform.localScale = new Vector3(reveal, 1, reveal);
|
// gamePos.transform.localScale = new Vector3(reveal, 1, reveal);
|
||||||
boisp = false;
|
// boisp = false;
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 设置组得标志
|
/// 设置组得标志
|
||||||
|
@ -277,7 +277,7 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
||||||
{
|
{
|
||||||
dataLinkCommunicationFrequency = change.transform.name;
|
dataLinkCommunicationFrequency = change.transform.name;
|
||||||
int layerValue = LayerMask.NameToLayer(dataLinkCommunicationFrequency);
|
int layerValue = LayerMask.NameToLayer(dataLinkCommunicationFrequency);
|
||||||
gamePos.layer = layerValue;
|
//gamePos.layer = layerValue;
|
||||||
string nowData = GetSyncDataTwo();
|
string nowData = GetSyncDataTwo();
|
||||||
MyNetMQClient.instance.Send(nowData);
|
MyNetMQClient.instance.Send(nowData);
|
||||||
equipmentCommon.SetDatabaseInfo("my_rate", dataLinkCommunicationFrequency);
|
equipmentCommon.SetDatabaseInfo("my_rate", dataLinkCommunicationFrequency);
|
||||||
|
@ -325,7 +325,7 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
||||||
{
|
{
|
||||||
int layerValue = LayerMask.NameToLayer(_frequency);
|
int layerValue = LayerMask.NameToLayer(_frequency);
|
||||||
dataLinkCommunicationFrequency = _frequency;
|
dataLinkCommunicationFrequency = _frequency;
|
||||||
gamePos.layer = layerValue;
|
//gamePos.layer = layerValue;
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 接受同步消息
|
/// 接受同步消息
|
||||||
|
@ -348,10 +348,10 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
||||||
{
|
{
|
||||||
Rotation_Angle.transform.Rotate(Vector3.up*10*Time.deltaTime);
|
Rotation_Angle.transform.Rotate(Vector3.up*10*Time.deltaTime);
|
||||||
}
|
}
|
||||||
if (isStartRehearsing)
|
//if (isStartRehearsing)
|
||||||
{
|
//{
|
||||||
gamePos.gameObject.SetActive(true);
|
// //gamePos.gameObject.SetActive(true);
|
||||||
}
|
//}
|
||||||
if (isStartRehearsing && equipmentCommon.isPlayer)
|
if (isStartRehearsing && equipmentCommon.isPlayer)
|
||||||
{
|
{
|
||||||
switch (pattern)
|
switch (pattern)
|
||||||
|
@ -395,23 +395,23 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
reveal = 30;
|
reveal = 30;
|
||||||
Mapdisplay();
|
//Mapdisplay();
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
reveal = 60;
|
reveal = 60;
|
||||||
Mapdisplay();
|
//Mapdisplay();
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
reveal = 90;
|
reveal = 90;
|
||||||
Mapdisplay();
|
//Mapdisplay();
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
reveal = 120;
|
reveal = 120;
|
||||||
Mapdisplay();
|
//Mapdisplay();
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
reveal = 150;
|
reveal = 150;
|
||||||
Mapdisplay();
|
//Mapdisplay();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -509,6 +509,7 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
||||||
&& allColliders[i].transform.GetComponent<HighPriorityTarget>()
|
&& allColliders[i].transform.GetComponent<HighPriorityTarget>()
|
||||||
&& allColliders[i].transform.GetComponent<HighPriorityTarget>().frequency == electronicReconnaissanceCapability)
|
&& allColliders[i].transform.GetComponent<HighPriorityTarget>().frequency == electronicReconnaissanceCapability)
|
||||||
{
|
{
|
||||||
|
|
||||||
attackColliders1.Add(allColliders[i]);
|
attackColliders1.Add(allColliders[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -698,8 +699,8 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
||||||
togFrequencyBands[k].gameObject.SetActive(date1.Contains(togFrequencyBands[k].transform.name));
|
togFrequencyBands[k].gameObject.SetActive(date1.Contains(togFrequencyBands[k].transform.name));
|
||||||
}
|
}
|
||||||
dataLinkCommunicationFrequency = dates1[0];
|
dataLinkCommunicationFrequency = dates1[0];
|
||||||
int layerValue = LayerMask.NameToLayer(dataLinkCommunicationFrequency);
|
//int layerValue = LayerMask.NameToLayer(dataLinkCommunicationFrequency);
|
||||||
gamePos.layer = layerValue;
|
//gamePos.layer = layerValue;
|
||||||
foreach (Toggle toggle in togFrequencyBands)
|
foreach (Toggle toggle in togFrequencyBands)
|
||||||
{
|
{
|
||||||
if (toggle.transform.name == dataLinkCommunicationFrequency)
|
if (toggle.transform.name == dataLinkCommunicationFrequency)
|
||||||
|
@ -826,38 +827,38 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 雷达检测无人机身上得RSC
|
/// 雷达检测无人机身上得RSC
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void CheckRSC()
|
//public void CheckRSC()
|
||||||
{
|
//{
|
||||||
if (string.IsNullOrEmpty(RCS))
|
// if (string.IsNullOrEmpty(RCS))
|
||||||
{
|
// {
|
||||||
float rcs = float.Parse(RCS);
|
// float rcs = float.Parse(RCS);
|
||||||
if (rcs <= 0.5 && rcs >= 0.1)
|
// if (rcs <= 0.5 && rcs >= 0.1)
|
||||||
{
|
// {
|
||||||
StartCoroutine(ShowRadarTips(0.8f, 2));
|
// StartCoroutine(ShowRadarTips(0.8f, 2));
|
||||||
}
|
// }
|
||||||
else if (rcs >= 0.5f && rcs <= 1)
|
// else if (rcs >= 0.5f && rcs <= 1)
|
||||||
{
|
// {
|
||||||
StartCoroutine(ShowRadarTips(0.4f, 1));
|
// StartCoroutine(ShowRadarTips(0.4f, 1));
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 多少时间在对方雷达界面上显示红色标记
|
/// 多少时间在对方雷达界面上显示红色标记
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="minTime"></param>
|
/// <param name="minTime"></param>
|
||||||
/// <param name="maxTime"></param>
|
/// <param name="maxTime"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private IEnumerator ShowRadarTips(float minTime, float maxTime)
|
//private IEnumerator ShowRadarTips(float minTime, float maxTime)
|
||||||
{
|
//{
|
||||||
GameObject tips = transform.Find("Minimapwrj").gameObject;
|
// GameObject tips = transform.Find("Minimapwrj").gameObject;
|
||||||
while (true)
|
// while (true)
|
||||||
{
|
// {
|
||||||
tips.gameObject.SetActive(false);
|
// tips.gameObject.SetActive(false);
|
||||||
float time = UnityEngine.Random.Range(minTime, maxTime);
|
// float time = UnityEngine.Random.Range(minTime, maxTime);
|
||||||
yield return new WaitForSeconds(time);
|
// yield return new WaitForSeconds(time);
|
||||||
tips.gameObject.SetActive(true);
|
// tips.gameObject.SetActive(true);
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
||||||
public LayerMask layerMask = new LayerMask();
|
public LayerMask layerMask = new LayerMask();
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -1162,7 +1163,7 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
||||||
if (isMove && positions.Count > 0)
|
if (isMove && positions.Count > 0)
|
||||||
{
|
{
|
||||||
isMove = false;
|
isMove = false;
|
||||||
gamePos.gameObject.SetActive(true);
|
//gamePos.gameObject.SetActive(true);
|
||||||
//gamemap.gameObject.SetActive(true);
|
//gamemap.gameObject.SetActive(true);
|
||||||
Vector3 _positions = positions.Dequeue();
|
Vector3 _positions = positions.Dequeue();
|
||||||
var nowData = GetSyncData(_positions);
|
var nowData = GetSyncData(_positions);
|
||||||
|
@ -1180,7 +1181,7 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public IEnumerator MoveObjectAlongPath(Vector3 _positions) // 协程:按路线移动物体
|
public IEnumerator MoveObjectAlongPath(Vector3 _positions) // 协程:按路线移动物体
|
||||||
{
|
{
|
||||||
gamePos.gameObject.SetActive(true);
|
//gamePos.gameObject.SetActive(true);
|
||||||
//gamemap.gameObject.SetActive(true);
|
//gamemap.gameObject.SetActive(true);
|
||||||
Vector3 targetPosition = new Vector3(_positions.x, hight, _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);
|
||||||
|
@ -1230,7 +1231,7 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
||||||
unmannedAerialVehicleManages.RemoveAt(i);
|
unmannedAerialVehicleManages.RemoveAt(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
StopCoroutine(ShowRadarTips(0, 0));
|
//StopCoroutine(ShowRadarTips(0, 0));
|
||||||
OnActivationChanged -= OnActivationChangedHandler;
|
OnActivationChanged -= OnActivationChangedHandler;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue