This commit is contained in:
YangHua 2024-01-04 13:50:38 +08:00
commit a638adf37f
6 changed files with 35 additions and 46 deletions

View File

@ -128,7 +128,7 @@ GameObject:
- component: {fileID: 4108524336644022762}
m_Layer: 12
m_Name: "\u5730\u9762\u65E0\u7EBF\u7535\u5E72\u6270"
m_TagString: AttackTarget1
m_TagString: AttackTarget
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0

View File

@ -58,7 +58,7 @@ Camera:
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 0
orthographic: 1
orthographic size: 5
m_Depth: 0
m_CullingMask:

View File

@ -10,6 +10,9 @@ public class Conversionfrequency : MonoBehaviour
public TerrestrialRadioInterferenceManger terrestrialRadioInterferenceManger;
public Dropdown dropdown;
/// <summary>
/// 改变频率的传值
/// </summary>
public int Smallfrequency;
/// <summary>
/// 取消频率设置按钮
@ -47,43 +50,11 @@ public class Conversionfrequency : MonoBehaviour
});
}
private void Radio()
{
switch (dropdown.value)
{
case 0:
disturb = "1227.60 MHz";
Debug.LogError(disturb);
break;
case 1:
disturb = "1381.05 MHz";
Debug.LogError(disturb);
break;
case 2:
disturb = "1575.42 MHz";
Debug.LogError(disturb);
break;
case 3:
disturb = "2GHz";
Debug.LogError(disturb);
break;
case 4:
disturb = "4GHz";
Debug.LogError(disturb);
break;
case 5:
disturb = "5GHz";
Debug.LogError(disturb);
break;
default:
break;
}
}
void Update()
{
//Radio();
//Smallfrequency=dropdown.value;
}
private void OnDestroy()
{

View File

@ -38,7 +38,7 @@ RenderSettings:
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 1113159741}
m_IndirectSpecularColor: {r: 0.16232237, g: 0.30615103, b: 0.66928816, a: 1}
m_IndirectSpecularColor: {r: 0.16231456, g: 0.30614573, b: 0.66931695, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
@ -63100,7 +63100,7 @@ MonoBehaviour:
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
randSeed: 1271443031
randSeed: 1780006765
isDoingTransition: 0
minimumHeight: 0
--- !u!114 &1820978574
@ -86115,6 +86115,11 @@ PrefabInstance:
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 343842254875067688, guid: 708d7629e400aea448483dd5797ffa36,
type: 3}
propertyPath: orthographic size
value: 5
objectReference: {fileID: 0}
- target: {fileID: 343842254875067690, guid: 708d7629e400aea448483dd5797ffa36,
type: 3}
propertyPath: m_Name
@ -86123,17 +86128,17 @@ PrefabInstance:
- target: {fileID: 343842254875067695, guid: 708d7629e400aea448483dd5797ffa36,
type: 3}
propertyPath: m_LocalPosition.x
value: -517
value: -490.9
objectReference: {fileID: 0}
- target: {fileID: 343842254875067695, guid: 708d7629e400aea448483dd5797ffa36,
type: 3}
propertyPath: m_LocalPosition.y
value: 500
value: 350
objectReference: {fileID: 0}
- target: {fileID: 343842254875067695, guid: 708d7629e400aea448483dd5797ffa36,
type: 3}
propertyPath: m_LocalPosition.z
value: 139
value: -12
objectReference: {fileID: 0}
- target: {fileID: 343842254875067695, guid: 708d7629e400aea448483dd5797ffa36,
type: 3}
@ -86175,7 +86180,8 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedComponents:
- {fileID: 343842254875067689, guid: 708d7629e400aea448483dd5797ffa36, type: 3}
m_SourcePrefab: {fileID: 100100000, guid: 708d7629e400aea448483dd5797ffa36, type: 3}
--- !u!1 &392437992739231324
GameObject:

View File

@ -119,11 +119,16 @@ public class RadarManger : MonoBehaviour
/// 批量标处理能力
/// </summary>
public int NumberOfProbes = 0;
// Start is called before the first frame update
/// <summary>
/// 渲染小地图摄像机
/// </summary>
public Camera Mincamera;
void Start()
{
Mincamera = GameObject.Find("Minimap Camera").GetComponent<Camera>();
equipmentCommon = GetComponent<EquipmentCommon>();
aniRandar = GetComponent<Animator>();
if (RadarUi == null)
{
CreateRadarUI();
@ -233,6 +238,7 @@ public class RadarManger : MonoBehaviour
case "探测距离:":
DetectionRange = weaponitemone[i].para_value;
detectionRadius = float.Parse(DetectionRange) * 100;
break;
case "近盲区:":
NearBlindArea = weaponitemone[i].para_value;
@ -290,8 +296,10 @@ public class RadarManger : MonoBehaviour
List<Collider> colliders = Physics.OverlapSphere(transform.position, detectionRadius).ToList(); // 检索范围内的所有碰撞体
int number = 0;
var colliders2 = colliders.FindAll(x => x.tag == "WRJ");
Mincamera.orthographicSize = detectionRadius;
if (colliders2.Count > 0)
{
for (int i = 0; i < colliders2.Count; i++)
{
if (i <= NumberOfProbes)
@ -326,6 +334,7 @@ public class RadarManger : MonoBehaviour
{
Debug.LogError("鼠标进入");
RadarUi.transform.localScale = Vector3.one;
Mincamera.transform.position = new Vector3(transform.position.x,350, transform.position.z);
}
private void OnMouseExit()
@ -336,6 +345,7 @@ public class RadarManger : MonoBehaviour
private void OnDestroy()
{
Destroy(RadarUi.gameObject);
OnActivationChanged -= OnActivationChangedHandler;
}
}

View File

@ -9,6 +9,7 @@ using static InterfaceManager;
using System;
using UnityEngine.UI;
using UnityEngine.EventSystems;
using UnityEditor.Experimental.GraphView;
/// <summary>
/// 地面无线电干扰控制
@ -98,6 +99,7 @@ public class TerrestrialRadioInterferenceManger : MonoBehaviour
equipmentCommon = GetComponent<EquipmentCommon>();
// 订阅布尔值变化事件
OnActivationChanged += OnActivationChangedHandler;
}
// Update is called once per frame
@ -127,7 +129,7 @@ public class TerrestrialRadioInterferenceManger : MonoBehaviour
/// <summary>
private void Detection()
{
if (Input.GetMouseButtonDown(0))
if (UIBootstrap.Instance.GetRoleByIDPracticeId(GlobalFlag.practiceSeatId) != "0" && Input.GetMouseButtonDown(0))
{
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
RaycastHit hit;
@ -137,7 +139,7 @@ public class TerrestrialRadioInterferenceManger : MonoBehaviour
{
return;
}
if (hit.transform.tag == "AttackTarget1")
if (hit.transform.tag == "AttackTarget" && hit.transform.gameObject.name == "地面无线电干扰(Clone)")
{
Conversionfrequency.Instance.terrestrialRadioInterferenceManger = hit.transform.GetComponent<TerrestrialRadioInterferenceManger>();
Conversionfrequency.Instance.transform.position = Camera.main.WorldToScreenPoint(hit.point);
@ -454,7 +456,7 @@ public class TerrestrialRadioInterferenceManger : MonoBehaviour
}
else
{
Debug.LogError("目标没有出现在范围里面");
Debug.LogError("目标没有出现在范围里面");
}
}