weewe
This commit is contained in:
parent
ed4fc75cad
commit
721c030834
|
@ -31,8 +31,8 @@ public class PostureController : MonoBehaviour
|
|||
|
||||
private void OnEnable()
|
||||
{
|
||||
redShowImage.gameObject.SetActive(false);
|
||||
blueShowImage.gameObject.SetActive(false);
|
||||
redShowImage.transform.parent.gameObject.SetActive(false);
|
||||
blueShowImage.transform.parent.gameObject.SetActive(false);
|
||||
GetSceneInfo();
|
||||
}
|
||||
/// <summary>
|
||||
|
@ -122,19 +122,19 @@ public class PostureController : MonoBehaviour
|
|||
{
|
||||
if (droneViewDisplay.renderTextureTo(id) == null)
|
||||
{
|
||||
redShowImage.gameObject.SetActive(false);
|
||||
blueShowImage.gameObject.SetActive(false);
|
||||
redShowImage.transform.parent.gameObject.SetActive(false);
|
||||
blueShowImage.transform.parent.gameObject.SetActive(false);
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(id)) return;
|
||||
if (redOrBlue == 0)
|
||||
{
|
||||
redShowImage.gameObject.SetActive(true);
|
||||
redShowImage.transform.parent.gameObject.SetActive(true);
|
||||
redShowImage.texture = droneViewDisplay.renderTextureTo(id);
|
||||
}
|
||||
else
|
||||
{
|
||||
blueShowImage.gameObject.SetActive(true);
|
||||
blueShowImage.transform.parent.gameObject.SetActive(true);
|
||||
blueShowImage.texture = droneViewDisplay.renderTextureTo(id);
|
||||
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ public class DroneViewDisplay : MonoSingleton<DroneViewDisplay>
|
|||
/// WRJUI集合
|
||||
/// </summary>
|
||||
public static List<RadioAngleView> radioAngleViews = new List<RadioAngleView>();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 所有无人机RenderTexture集合
|
||||
/// </summary>
|
||||
|
@ -22,17 +22,17 @@ public class DroneViewDisplay : MonoSingleton<DroneViewDisplay>
|
|||
/// <summary>
|
||||
/// UIPrefab
|
||||
/// </summary>
|
||||
[Header("UIPrefab")]
|
||||
[Header("UIPrefab")]
|
||||
public GameObject prefabRadioAngleView;
|
||||
/// <summary>
|
||||
/// 放大显示
|
||||
/// </summary>
|
||||
[Header("放大显示")]
|
||||
[Header("放大显示")]
|
||||
public Transform radioAngleViewMax;
|
||||
/// <summary>
|
||||
/// 放大显示无人机名称
|
||||
/// </summary>
|
||||
[Header("放大显示无人机名称")]
|
||||
[Header("放大显示无人机名称")]
|
||||
public Text textNmme;
|
||||
/// <summary>
|
||||
/// 放大显示关闭按钮
|
||||
|
@ -45,7 +45,7 @@ public class DroneViewDisplay : MonoSingleton<DroneViewDisplay>
|
|||
[Header("无线电探测放大显示视角显示RawImage")]
|
||||
public RawImage rawShow;
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
|
@ -88,7 +88,7 @@ public class DroneViewDisplay : MonoSingleton<DroneViewDisplay>
|
|||
{
|
||||
radioAngleViewMain.deviceID = unmannedAerialVehicleManage.equipmentCommon.deviceID;
|
||||
radioAngleViewMain.textNmme.text = unmannedAerialVehicleManage.transform.name;
|
||||
radioAngleViewMain.typeWRJ= unmannedAerialVehicleManage.wrjModel;
|
||||
radioAngleViewMain.typeWRJ = unmannedAerialVehicleManage.wrjModel;
|
||||
Mask mask = wrj.transform.GetComponentInChildren<Mask>();
|
||||
if (mask)
|
||||
mask.enabled = unmannedAerialVehicleManage.wrjModel == WRJModel.电子侦察无人机 ? true : false;
|
||||
|
@ -96,7 +96,7 @@ public class DroneViewDisplay : MonoSingleton<DroneViewDisplay>
|
|||
// 创建 RenderTexture
|
||||
RenderTexture renderTexture = new RenderTexture(500, 500, 0);
|
||||
renderTexture.name = unmannedAerialVehicleManage.equipmentCommon.deviceID;
|
||||
if(unmannedAerialVehicleManage.wrjModel == WRJModel.电子侦察无人机)
|
||||
if (unmannedAerialVehicleManage.wrjModel == WRJModel.电子侦察无人机)
|
||||
{
|
||||
unmannedAerialVehicleManage.dzWRJCamera.gameObject.SetActive(true);
|
||||
}
|
||||
|
@ -123,10 +123,10 @@ public class DroneViewDisplay : MonoSingleton<DroneViewDisplay>
|
|||
/// <param name="deviceID"></param>
|
||||
/// <param name="camera"></param>
|
||||
/// <param name="rawImage"></param>
|
||||
public void CreateUI(string deviceID,Camera camera,RawImage rawImage)
|
||||
public void CreateUI(string deviceID, Camera camera, RawImage rawImage)
|
||||
{
|
||||
if (deviceID.Length < 10) return;
|
||||
var v= renderTextures.Find(x=>x.name== deviceID);
|
||||
var v = renderTextures.Find(x => x.name == deviceID);
|
||||
if (v != null) return;
|
||||
RenderTexture renderTexture = new RenderTexture(500, 500, 0);
|
||||
renderTexture.name = deviceID;
|
||||
|
@ -141,12 +141,12 @@ public class DroneViewDisplay : MonoSingleton<DroneViewDisplay>
|
|||
/// <param name="deviceID"></param>
|
||||
public void DistroyUI(string deviceID)
|
||||
{
|
||||
if(deviceID.Length < 10) return;
|
||||
if (deviceID.Length < 10) return;
|
||||
RadioAngleView radioAngleView = radioAngleViews.Find(x => x != null && x.deviceID == deviceID);
|
||||
if (radioAngleView)
|
||||
{
|
||||
Destroy(radioAngleView.gameObject);
|
||||
for(int i= 0; i < radioAngleViews.Count; i++)
|
||||
for (int i = 0; i < radioAngleViews.Count; i++)
|
||||
{
|
||||
if (radioAngleViews[i] == null)
|
||||
{
|
||||
|
@ -177,9 +177,10 @@ public class DroneViewDisplay : MonoSingleton<DroneViewDisplay>
|
|||
public RenderTexture renderTextureTo(string deviceID)
|
||||
{
|
||||
RenderTexture radioAngleView = null;
|
||||
if (renderTextures.Count == 0) return null;
|
||||
for (int i = 0; i < renderTextures.Count; i++)
|
||||
{
|
||||
if(renderTextures[i].name == deviceID)
|
||||
if (renderTextures[i] != null && renderTextures[i].name == deviceID)
|
||||
{
|
||||
radioAngleView = renderTextures[i];
|
||||
return radioAngleView;
|
||||
|
@ -193,7 +194,7 @@ public class DroneViewDisplay : MonoSingleton<DroneViewDisplay>
|
|||
/// </summary>
|
||||
/// <param name="_textNmme"></param>
|
||||
/// <param name="rawShow"></param
|
||||
public void RadioAngleViewMaxShow(string _textNmme , RawImage _rawShow, WRJModel wRJModel)
|
||||
public void RadioAngleViewMaxShow(string _textNmme, RawImage _rawShow, WRJModel wRJModel)
|
||||
{
|
||||
rawShow.texture = null;
|
||||
radioAngleViewMax.localScale = Vector3.one;
|
||||
|
|
Loading…
Reference in New Issue