This commit is contained in:
YangHua 2024-03-22 15:55:19 +08:00
parent c2e0f24726
commit 7245f8cbef
2 changed files with 73 additions and 36 deletions

View File

@ -1172,7 +1172,11 @@ RectTransform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0, y: 0, z: 0}
m_Children: []
m_Children:
- {fileID: 5433276239701250115}
- {fileID: 8129871292636694300}
- {fileID: 9020723963205404447}
- {fileID: 571368241678502618}
m_Father: {fileID: 8500453589301871558}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -1450,10 +1454,6 @@ Transform:
- {fileID: 1525602421726030359}
- {fileID: 5172610439169658982}
- {fileID: 7180026123191704634}
- {fileID: 5433276239701250115}
- {fileID: 8129871292636694300}
- {fileID: 9020723963205404447}
- {fileID: 571368241678502618}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -1632,6 +1632,11 @@ MonoBehaviour:
m_Bits: 0
boisp: 1
attackColliders1: []
targets: []
radarCenter: {fileID: 0}
radarBackground: {fileID: 0}
targetPointPrefab: {fileID: 0}
radarBaseMap: {fileID: 0}
currentCollider: {fileID: 0}
layerMask:
serializedVersion: 2
@ -1683,18 +1688,18 @@ RectTransform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 9020723963205404446}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: -1.28}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 32362716923635516}
- {fileID: 6402137036825572936}
- {fileID: 6827470219295874954}
m_Father: {fileID: 8500453589301871558}
m_RootOrder: 7
m_Father: {fileID: 7180026123191704634}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 960, y: 540.96}
m_AnchoredPosition: {x: 0, y: -0.049926758}
m_SizeDelta: {x: 130, y: 150}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &9020723963205404445
@ -2814,7 +2819,7 @@ PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 8500453589301871558}
m_TransformParent: {fileID: 7180026123191704634}
m_Modifications:
- target: {fileID: 2477564191442231658, guid: ba4a837ca06ca3f4f96d140b7e44a3c5,
type: 3}
@ -2829,7 +2834,7 @@ PrefabInstance:
- target: {fileID: 2477564191442231658, guid: ba4a837ca06ca3f4f96d140b7e44a3c5,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
value: 1.28
objectReference: {fileID: 0}
- target: {fileID: 2477564191442231658, guid: ba4a837ca06ca3f4f96d140b7e44a3c5,
type: 3}
@ -2854,7 +2859,7 @@ PrefabInstance:
- target: {fileID: 2477564191442231658, guid: ba4a837ca06ca3f4f96d140b7e44a3c5,
type: 3}
propertyPath: m_RootOrder
value: 8
value: 3
objectReference: {fileID: 0}
- target: {fileID: 2477564191442231658, guid: ba4a837ca06ca3f4f96d140b7e44a3c5,
type: 3}
@ -2874,12 +2879,12 @@ PrefabInstance:
- target: {fileID: 2477564191442231658, guid: ba4a837ca06ca3f4f96d140b7e44a3c5,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
value: -960
objectReference: {fileID: 0}
- target: {fileID: 2477564191442231658, guid: ba4a837ca06ca3f4f96d140b7e44a3c5,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 3.5
value: -537.51
objectReference: {fileID: 0}
- target: {fileID: 2477564191442231658, guid: ba4a837ca06ca3f4f96d140b7e44a3c5,
type: 3}
@ -3082,7 +3087,7 @@ PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 8500453589301871558}
m_TransformParent: {fileID: 7180026123191704634}
m_Modifications:
- target: {fileID: 438240288241169162, guid: 38fb1def99b2cd147a96842efe5a355b,
type: 3}
@ -3187,7 +3192,7 @@ PrefabInstance:
- target: {fileID: 1649737328956898977, guid: 38fb1def99b2cd147a96842efe5a355b,
type: 3}
propertyPath: m_LocalPosition.z
value: -1.28
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1649737328956898977, guid: 38fb1def99b2cd147a96842efe5a355b,
type: 3}
@ -3212,7 +3217,7 @@ PrefabInstance:
- target: {fileID: 1649737328956898977, guid: 38fb1def99b2cd147a96842efe5a355b,
type: 3}
propertyPath: m_RootOrder
value: 5
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1649737328956898977, guid: 38fb1def99b2cd147a96842efe5a355b,
type: 3}
@ -3232,12 +3237,12 @@ PrefabInstance:
- target: {fileID: 1649737328956898977, guid: 38fb1def99b2cd147a96842efe5a355b,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 960
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1649737328956898977, guid: 38fb1def99b2cd147a96842efe5a355b,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 540.96
value: -0.049926758
objectReference: {fileID: 0}
- target: {fileID: 1649737328956898977, guid: 38fb1def99b2cd147a96842efe5a355b,
type: 3}
@ -3645,7 +3650,7 @@ PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 8500453589301871558}
m_TransformParent: {fileID: 7180026123191704634}
m_Modifications:
- target: {fileID: 438240288241169162, guid: 38fb1def99b2cd147a96842efe5a355b,
type: 3}
@ -3750,7 +3755,7 @@ PrefabInstance:
- target: {fileID: 1649737328956898977, guid: 38fb1def99b2cd147a96842efe5a355b,
type: 3}
propertyPath: m_LocalPosition.z
value: -1.28
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1649737328956898977, guid: 38fb1def99b2cd147a96842efe5a355b,
type: 3}
@ -3775,7 +3780,7 @@ PrefabInstance:
- target: {fileID: 1649737328956898977, guid: 38fb1def99b2cd147a96842efe5a355b,
type: 3}
propertyPath: m_RootOrder
value: 6
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1649737328956898977, guid: 38fb1def99b2cd147a96842efe5a355b,
type: 3}
@ -3795,12 +3800,12 @@ PrefabInstance:
- target: {fileID: 1649737328956898977, guid: 38fb1def99b2cd147a96842efe5a355b,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 960
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1649737328956898977, guid: 38fb1def99b2cd147a96842efe5a355b,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 540.96
value: -0.049926758
objectReference: {fileID: 0}
- target: {fileID: 1649737328956898977, guid: 38fb1def99b2cd147a96842efe5a355b,
type: 3}

View File

@ -346,7 +346,7 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
{
if (isStartRehearsing)
{
Rotation_Angle.transform.Rotate(Vector3.up*10*Time.deltaTime);
Rotation_Angle.transform.Rotate(Vector3.up * 10 * Time.deltaTime);
}
//if (isStartRehearsing)
//{
@ -489,6 +489,45 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
public List<Collider> attackColliders1 = new List<Collider>();
public List<Collider> targets = new List<Collider>();
public Transform radarCenter;
public Image radarBackground;
public GameObject targetPointPrefab;
public RawImage radarBaseMap;
/// <summary>
/// 获取所有符合条件的设备
/// </summary>
/// <returns></returns>
public bool GetQualifiedEquipment(Collider obj)
{
if (obj.gameObject.tag == "AttackTarget"
&& !obj.isTrigger
&& !attackColliders1.Contains(obj)
&& obj.transform.GetComponent<HighPriorityTarget>()
&& obj.transform.GetComponent<HighPriorityTarget>().frequency == electronicReconnaissanceCapability)
return true;
else
return false;
}
/// <summary>
/// 在UI图上显示雷达点
/// </summary>
public void ShowRadarPoint()
{
foreach (Transform child in radarBaseMap.transform)
{
Destroy(child.gameObject);
}
foreach (Collider target in targets)
{
Vector3 relativePosition = target.transform.position - radarCenter.position;
Vector2 radarPosition = new Vector2(relativePosition.x, relativePosition.z) * 0.1f;
GameObject point = Instantiate(targetPointPrefab, radarBaseMap.transform);
RectTransform rt = point.GetComponent<RectTransform>();
rt.anchoredPosition = radarPosition;
}
}
/// <summary>
/// 攻击打击
@ -501,18 +540,11 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
if (wrjModel == WRJModel.)
{
List<Collider> allColliders = Physics.OverlapSphere(transform.position, Spectrumdetection.Radius * 1000).ToList(); // 检索范围内的所有碰撞体
for (int i = 0; i < allColliders.Count; i++)
targets = allColliders.FindAll(GetQualifiedEquipment);
for (int i = 0; i < targets.Count; i++)
{
if (allColliders[i].gameObject.tag == "AttackTarget"
&& !allColliders[i].isTrigger
&& !attackColliders1.Contains(allColliders[i])
&& allColliders[i].transform.GetComponent<HighPriorityTarget>()
&& allColliders[i].transform.GetComponent<HighPriorityTarget>().frequency == electronicReconnaissanceCapability)
{
attackColliders1.Add(allColliders[i]);
}
attackColliders1.Add(targets[i]);
}
}
else if (wrjModel == WRJModel.)