This commit is contained in:
parent
a7f29ce501
commit
18dd84bf8b
|
@ -10021,6 +10021,7 @@ MonoBehaviour:
|
||||||
NumberOfProbes: 31
|
NumberOfProbes: 31
|
||||||
minCamera: {fileID: 1822639428928488196}
|
minCamera: {fileID: 1822639428928488196}
|
||||||
imageprs: {fileID: 8234605787508067104}
|
imageprs: {fileID: 8234605787508067104}
|
||||||
|
rawImage: {fileID: 2648302242586125239}
|
||||||
--- !u!54 &916690897
|
--- !u!54 &916690897
|
||||||
Rigidbody:
|
Rigidbody:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
@ -736,6 +736,7 @@ MonoBehaviour:
|
||||||
toggle7: {fileID: 117463751223528660}
|
toggle7: {fileID: 117463751223528660}
|
||||||
Frequency:
|
Frequency:
|
||||||
camera: {fileID: 480111845}
|
camera: {fileID: 480111845}
|
||||||
|
rawImage: {fileID: 1115657768}
|
||||||
--- !u!65 &1537869982341012852
|
--- !u!65 &1537869982341012852
|
||||||
BoxCollider:
|
BoxCollider:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
@ -88,14 +88,18 @@ public class Spectrumdetection : MonoBehaviour
|
||||||
/// 摄像机显示层数
|
/// 摄像机显示层数
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Camera camera;
|
public Camera camera;
|
||||||
|
|
||||||
|
public RawImage rawImage;
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
spectrumdetections.Add(this);
|
spectrumdetections.Add(this);
|
||||||
|
|
||||||
equipmentCommon = GetComponent<EquipmentCommon>();
|
equipmentCommon = GetComponent<EquipmentCommon>();
|
||||||
// 订阅布尔值变化事件
|
// 订阅布尔值变化事件
|
||||||
OnActivationChanged += OnActivationChangedHandler;
|
OnActivationChanged += OnActivationChangedHandler;
|
||||||
_isStartRehearsing = GlobalFlag.isStartRehearsing;
|
_isStartRehearsing = GlobalFlag.isStartRehearsing;
|
||||||
Microwave();
|
Microwave();
|
||||||
|
DroneViewDisplay.Instance.CreateUI(equipmentCommon.deviceID, camera, rawImage);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Microwave()
|
private void Microwave()
|
||||||
|
|
|
@ -123,31 +123,22 @@ public class RadarManger : MonoBehaviour
|
||||||
/// 激活面板预设体
|
/// 激活面板预设体
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Image imageprs;
|
public Image imageprs;
|
||||||
|
|
||||||
|
public RawImage rawImage;
|
||||||
void Awake()
|
void Awake()
|
||||||
{
|
{
|
||||||
//minCamera = GameObject.Find("Minimap Camera").GetComponent<Camera>();
|
|
||||||
}
|
}
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
|
|
||||||
equipmentCommon = GetComponent<EquipmentCommon>();
|
equipmentCommon = GetComponent<EquipmentCommon>();
|
||||||
//aniRandar = imageprs.GetComponent<Animator>();
|
|
||||||
|
|
||||||
//if (RadarUi == null)
|
|
||||||
//{
|
|
||||||
// CreateRadarUI();
|
|
||||||
//}
|
|
||||||
// 订阅布尔值变化事件
|
// 订阅布尔值变化事件
|
||||||
OnActivationChanged += OnActivationChangedHandler;
|
OnActivationChanged += OnActivationChangedHandler;
|
||||||
//InvokeRepeating("RetrievalUAV", 1, 5);//测试用
|
DroneViewDisplay.Instance.CreateUI(equipmentCommon.deviceID, minCamera, rawImage);
|
||||||
}
|
|
||||||
|
|
||||||
// Update is called once per frame
|
|
||||||
void Update()
|
|
||||||
{
|
|
||||||
//if (equipmentCommon.isPlayer)
|
|
||||||
// RetrievalUAV();//看向无人机
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#region 启动暂停
|
#region 启动暂停
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 导条变化调用
|
/// 导条变化调用
|
||||||
|
@ -205,22 +196,6 @@ public class RadarManger : MonoBehaviour
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 生成雷达UI
|
|
||||||
/// </summary>
|
|
||||||
//void CreateRadarUI()
|
|
||||||
//{
|
|
||||||
// Transform canvas = GameObject.Find("Canvas").transform;
|
|
||||||
// if (canvas)
|
|
||||||
// {
|
|
||||||
// GameObject _object = Instantiate(RadarUiPrefab, canvas);
|
|
||||||
// RadarUi = _object;
|
|
||||||
// RadarUi.transform.localScale = Vector3.zero;
|
|
||||||
// aniRandarUI = RadarUi.GetComponent<Animator>();
|
|
||||||
// RadarRotationSpeed(TurntableSpeed);
|
|
||||||
// }
|
|
||||||
|
|
||||||
//}
|
|
||||||
void CreateRadarUI()
|
void CreateRadarUI()
|
||||||
{
|
{
|
||||||
imageprs.transform.localScale = Vector3.zero;
|
imageprs.transform.localScale = Vector3.zero;
|
||||||
|
|
|
@ -14,6 +14,7 @@ public class DroneViewDisplay : MonoSingleton<DroneViewDisplay>
|
||||||
/// WRJUI集合
|
/// WRJUI集合
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static List<RadioAngleView> radioAngleViews = new List<RadioAngleView>();
|
public static List<RadioAngleView> radioAngleViews = new List<RadioAngleView>();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 所有无人机RenderTexture集合
|
/// 所有无人机RenderTexture集合
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -113,6 +114,21 @@ public class DroneViewDisplay : MonoSingleton<DroneViewDisplay>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="deviceID"></param>
|
||||||
|
/// <param name="camera"></param>
|
||||||
|
/// <param name="rawImage"></param>
|
||||||
|
public void CreateUI(string deviceID,Camera camera,RawImage rawImage)
|
||||||
|
{
|
||||||
|
RenderTexture renderTexture = new RenderTexture(500, 500, 0);
|
||||||
|
renderTexture.name = deviceID;
|
||||||
|
camera.targetTexture = renderTexture;
|
||||||
|
rawImage.texture = renderTexture;
|
||||||
|
renderTextures.Add(renderTexture);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 删除无人机UI
|
/// 删除无人机UI
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
Loading…
Reference in New Issue