Merge branch 'master' of http://git.umayle.com:2023/yulong/NewN_UAVPlane
This commit is contained in:
commit
4327751b70
|
@ -1,5 +1,6 @@
|
||||||
using AdamThinkDevicesData;
|
using AdamThinkDevicesData;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
@ -90,8 +91,14 @@ public class Spectrumdetection : MonoBehaviour
|
||||||
/// 摄像机显示层数
|
/// 摄像机显示层数
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Camera camera;
|
public Camera camera;
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public RawImage rawImage;
|
public RawImage rawImage;
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
private bool onlyOne = true;
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
spectrumdetections.Add(this);
|
spectrumdetections.Add(this);
|
||||||
|
@ -101,9 +108,18 @@ public class Spectrumdetection : MonoBehaviour
|
||||||
OnActivationChanged += OnActivationChangedHandler;
|
OnActivationChanged += OnActivationChangedHandler;
|
||||||
_isStartRehearsing = GlobalFlag.isStartRehearsing;
|
_isStartRehearsing = GlobalFlag.isStartRehearsing;
|
||||||
Microwave();
|
Microwave();
|
||||||
DroneViewDisplay.Instance.CreateUI(equipmentCommon.deviceID, camera, rawImage);
|
//DroneViewDisplay.Instance.CreateUI(equipmentCommon.deviceID, camera, rawImage);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Update()
|
||||||
|
{
|
||||||
|
if (onlyOne && equipmentCommon.deviceID.Length > 10)
|
||||||
|
{
|
||||||
|
onlyOne = false;
|
||||||
|
DroneViewDisplay.Instance.CreateUI(equipmentCommon.deviceID, camera, rawImage);
|
||||||
|
}
|
||||||
|
Search();//微波武器朝向无人机
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Microwave()
|
private void Microwave()
|
||||||
{
|
{
|
||||||
frenbutton.onClick.AddListener(() =>
|
frenbutton.onClick.AddListener(() =>
|
||||||
|
@ -341,11 +357,6 @@ public class Spectrumdetection : MonoBehaviour
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Update()
|
|
||||||
{
|
|
||||||
Search();//微波武器朝向无人机
|
|
||||||
//Emittedray();
|
|
||||||
}
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 点击物体生成页面
|
/// 点击物体生成页面
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -150,7 +150,10 @@ public class LaserFireControlPlatformManger : MonoBehaviour
|
||||||
/// 激光火炮打击时间
|
/// 激光火炮打击时间
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public float storageIntervalTime;
|
public float storageIntervalTime;
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
private bool onlyOne = true;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 判断物体是否在相机里面
|
/// 判断物体是否在相机里面
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -159,7 +162,6 @@ public class LaserFireControlPlatformManger : MonoBehaviour
|
||||||
{
|
{
|
||||||
equipmentCommon = GetComponent<EquipmentCommon>();
|
equipmentCommon = GetComponent<EquipmentCommon>();
|
||||||
laserFireControlPlatformMangers.Add(this);
|
laserFireControlPlatformMangers.Add(this);
|
||||||
DroneViewDisplay.Instance.CreateUI(equipmentCommon.deviceID, camera, raw);
|
|
||||||
//生成激光
|
//生成激光
|
||||||
GameObject _InnerLaserlineRenderer = Instantiate(InnerLaserlineRendererPrefab);
|
GameObject _InnerLaserlineRenderer = Instantiate(InnerLaserlineRendererPrefab);
|
||||||
_InnerLaserlineRenderer.transform.position = Vector3.zero;
|
_InnerLaserlineRenderer.transform.position = Vector3.zero;
|
||||||
|
@ -181,34 +183,18 @@ public class LaserFireControlPlatformManger : MonoBehaviour
|
||||||
OuterLaserlineRenderer.SetPosition(0, LaserPoint.transform.position);// 设置线段起点为物体位置
|
OuterLaserlineRenderer.SetPosition(0, LaserPoint.transform.position);// 设置线段起点为物体位置
|
||||||
OuterLaserlineRenderer.SetPosition(1, LaserPoint.transform.position);// 设置线段终点为目标点
|
OuterLaserlineRenderer.SetPosition(1, LaserPoint.transform.position);// 设置线段终点为目标点
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Update()
|
void Update()
|
||||||
{
|
{
|
||||||
lasertime -= Time.deltaTime;
|
lasertime -= Time.deltaTime;
|
||||||
|
if (onlyOne && equipmentCommon.deviceID.Length > 10)
|
||||||
//if (UIBootstrap.Instance.GetRoleByIDPracticeId(GlobalFlag.practiceSeatId) != "0" && Input.GetMouseButtonDown(0))
|
{
|
||||||
//{
|
onlyOne = false;
|
||||||
// Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
|
DroneViewDisplay.Instance.CreateUI(equipmentCommon.deviceID, camera, raw);
|
||||||
// RaycastHit hit;
|
}
|
||||||
// if (Physics.Raycast(ray, out hit))
|
|
||||||
// {
|
|
||||||
// if (EventSystem.current.IsPointerOverGameObject())
|
|
||||||
// {
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// if (hit.transform.gameObject.tag == "AttackTarget" && hit.transform.GetComponent<LaserFireControlPlatformManger>())
|
|
||||||
// {
|
|
||||||
// Transform canvas = GameObject.Find("Canvas").transform;
|
|
||||||
// if (canvas)
|
|
||||||
// {
|
|
||||||
// Instantiate(RawImage, canvas);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -463,7 +449,8 @@ public class LaserFireControlPlatformManger : MonoBehaviour
|
||||||
//{
|
//{
|
||||||
// Instantiate(RawImage, canvas);
|
// Instantiate(RawImage, canvas);
|
||||||
//}
|
//}
|
||||||
rawImageUIObj.SetActive(true);
|
if (GlobalFlag.blueOrRed == 1)
|
||||||
|
rawImageUIObj.SetActive(true);
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 检查鼠标是否离开物体
|
/// 检查鼠标是否离开物体
|
||||||
|
|
|
@ -123,8 +123,14 @@ public class RadarManger : MonoBehaviour
|
||||||
/// 激活面板预设体
|
/// 激活面板预设体
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Image imageprs;
|
public Image imageprs;
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public RawImage rawImage;
|
public RawImage rawImage;
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
private bool onlyOne = true;
|
||||||
void Awake()
|
void Awake()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -136,9 +142,17 @@ public class RadarManger : MonoBehaviour
|
||||||
|
|
||||||
// 订阅布尔值变化事件
|
// 订阅布尔值变化事件
|
||||||
OnActivationChanged += OnActivationChangedHandler;
|
OnActivationChanged += OnActivationChangedHandler;
|
||||||
DroneViewDisplay.Instance.CreateUI(equipmentCommon.deviceID, minCamera, rawImage);
|
//DroneViewDisplay.Instance.CreateUI(equipmentCommon.deviceID, minCamera, rawImage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Update()
|
||||||
|
{
|
||||||
|
if (onlyOne && equipmentCommon.deviceID.Length > 10)
|
||||||
|
{
|
||||||
|
onlyOne = false;
|
||||||
|
DroneViewDisplay.Instance.CreateUI(equipmentCommon.deviceID, minCamera, rawImage);
|
||||||
|
}
|
||||||
|
}
|
||||||
#region 启动暂停
|
#region 启动暂停
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 导条变化调用
|
/// 导条变化调用
|
||||||
|
|
|
@ -126,6 +126,9 @@ public class DroneViewDisplay : MonoSingleton<DroneViewDisplay>
|
||||||
/// <param name="rawImage"></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);
|
||||||
|
if (v != null) return;
|
||||||
RenderTexture renderTexture = new RenderTexture(500, 500, 0);
|
RenderTexture renderTexture = new RenderTexture(500, 500, 0);
|
||||||
renderTexture.name = deviceID;
|
renderTexture.name = deviceID;
|
||||||
camera.targetTexture = renderTexture;
|
camera.targetTexture = renderTexture;
|
||||||
|
|
Loading…
Reference in New Issue