This commit is contained in:
parent
a7f29ce501
commit
18dd84bf8b
|
@ -10021,6 +10021,7 @@ MonoBehaviour:
|
|||
NumberOfProbes: 31
|
||||
minCamera: {fileID: 1822639428928488196}
|
||||
imageprs: {fileID: 8234605787508067104}
|
||||
rawImage: {fileID: 2648302242586125239}
|
||||
--- !u!54 &916690897
|
||||
Rigidbody:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
|
@ -736,6 +736,7 @@ MonoBehaviour:
|
|||
toggle7: {fileID: 117463751223528660}
|
||||
Frequency:
|
||||
camera: {fileID: 480111845}
|
||||
rawImage: {fileID: 1115657768}
|
||||
--- !u!65 &1537869982341012852
|
||||
BoxCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
|
@ -88,14 +88,18 @@ public class Spectrumdetection : MonoBehaviour
|
|||
/// 摄像机显示层数
|
||||
/// </summary>
|
||||
public Camera camera;
|
||||
|
||||
public RawImage rawImage;
|
||||
void Start()
|
||||
{
|
||||
spectrumdetections.Add(this);
|
||||
|
||||
equipmentCommon = GetComponent<EquipmentCommon>();
|
||||
// 订阅布尔值变化事件
|
||||
OnActivationChanged += OnActivationChangedHandler;
|
||||
_isStartRehearsing = GlobalFlag.isStartRehearsing;
|
||||
Microwave();
|
||||
DroneViewDisplay.Instance.CreateUI(equipmentCommon.deviceID, camera, rawImage);
|
||||
}
|
||||
|
||||
private void Microwave()
|
||||
|
|
|
@ -123,31 +123,22 @@ public class RadarManger : MonoBehaviour
|
|||
/// 激活面板预设体
|
||||
/// </summary>
|
||||
public Image imageprs;
|
||||
|
||||
public RawImage rawImage;
|
||||
void Awake()
|
||||
{
|
||||
//minCamera = GameObject.Find("Minimap Camera").GetComponent<Camera>();
|
||||
|
||||
}
|
||||
void Start()
|
||||
{
|
||||
|
||||
equipmentCommon = GetComponent<EquipmentCommon>();
|
||||
//aniRandar = imageprs.GetComponent<Animator>();
|
||||
|
||||
//if (RadarUi == null)
|
||||
//{
|
||||
// CreateRadarUI();
|
||||
//}
|
||||
// 订阅布尔值变化事件
|
||||
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 启动暂停
|
||||
/// <summary>
|
||||
/// 导条变化调用
|
||||
|
@ -205,22 +196,6 @@ public class RadarManger : MonoBehaviour
|
|||
}
|
||||
#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()
|
||||
{
|
||||
imageprs.transform.localScale = Vector3.zero;
|
||||
|
|
|
@ -14,6 +14,7 @@ public class DroneViewDisplay : MonoSingleton<DroneViewDisplay>
|
|||
/// WRJUI集合
|
||||
/// </summary>
|
||||
public static List<RadioAngleView> radioAngleViews = new List<RadioAngleView>();
|
||||
|
||||
/// <summary>
|
||||
/// 所有无人机RenderTexture集合
|
||||
/// </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>
|
||||
/// 删除无人机UI
|
||||
/// </summary>
|
||||
|
|
Loading…
Reference in New Issue