Merge branch 'master' of http://git.umayle.com:2023/yulong/NewN_UAVPlane
This commit is contained in:
commit
09d29f1446
|
@ -251,6 +251,7 @@ public class Microwaveweapon : MonoBehaviour
|
||||||
//MQTTManager.instance.SendData(MQTTManager.instance.Planedata, newdata);
|
//MQTTManager.instance.SendData(MQTTManager.instance.Planedata, newdata);
|
||||||
yield return new WaitForSeconds(0.5f);
|
yield return new WaitForSeconds(0.5f);
|
||||||
GameObject game = Instantiate(Destructioneffect, unmannedAerialVehicle.transform);
|
GameObject game = Instantiate(Destructioneffect, unmannedAerialVehicle.transform);
|
||||||
|
yield return new WaitForSeconds(0.1f);
|
||||||
game.transform.localPosition = Vector3.zero;
|
game.transform.localPosition = Vector3.zero;
|
||||||
game.transform.SetParent(null);
|
game.transform.SetParent(null);
|
||||||
game.SetActive(true);
|
game.SetActive(true);
|
||||||
|
|
|
@ -472,12 +472,6 @@ public class GameManager : MonoSingleton<GameManager>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (uavm)
|
|
||||||
{
|
|
||||||
uavm.SetTipsColor();
|
|
||||||
DroneViewDisplay.Instance.CreateUI(uavm, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
Debug.Log($"<color=yellow>是否是player{data.r3 == GlobalFlag.currentUser.user_id}</color>");
|
Debug.Log($"<color=yellow>是否是player{data.r3 == GlobalFlag.currentUser.user_id}</color>");
|
||||||
device.GetComponent<EquipmentCommon>().FillInTheData(data.list_para, data);
|
device.GetComponent<EquipmentCommon>().FillInTheData(data.list_para, data);
|
||||||
device.GetComponent<EquipmentCommon>().deviceID = data.id;
|
device.GetComponent<EquipmentCommon>().deviceID = data.id;
|
||||||
|
@ -485,7 +479,11 @@ public class GameManager : MonoSingleton<GameManager>
|
||||||
{
|
{
|
||||||
device.GetComponent<EquipmentCommon>().isPlayer = true;
|
device.GetComponent<EquipmentCommon>().isPlayer = true;
|
||||||
}
|
}
|
||||||
|
if (uavm)
|
||||||
|
{
|
||||||
|
uavm.SetTipsColor();
|
||||||
|
DroneViewDisplay.Instance.CreateUI(uavm, false);
|
||||||
|
}
|
||||||
FormationManager.Instance.WhenSpawn();
|
FormationManager.Instance.WhenSpawn();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -75,7 +75,7 @@ public class HighPriorityTarget : MonoBehaviour
|
||||||
public GameObject gamepos;
|
public GameObject gamepos;
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
gamepos.gameObject.SetActive(false);
|
//gamepos.gameObject.SetActive(false);
|
||||||
HighPriorityTargets.Add(this);
|
HighPriorityTargets.Add(this);
|
||||||
Number = HighPriorityTargets.Count.ToString();
|
Number = HighPriorityTargets.Count.ToString();
|
||||||
buttonreg.onClick.AddListener(() =>
|
buttonreg.onClick.AddListener(() =>
|
||||||
|
@ -143,28 +143,28 @@ public class HighPriorityTarget : MonoBehaviour
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (Spectrumdetection.Radius > 0)
|
//if (Spectrumdetection.Radius > 0)
|
||||||
{
|
//{
|
||||||
if (gamepos)
|
// if (gamepos)
|
||||||
{
|
// {
|
||||||
gamepos.gameObject.SetActive(true);
|
// gamepos.gameObject.SetActive(true);
|
||||||
switch (Spectrumdetection.Radius)
|
// switch (Spectrumdetection.Radius)
|
||||||
{
|
// {
|
||||||
case 1:
|
// case 1:
|
||||||
gamepos.transform.localScale = new Vector3(10, 1, 10);
|
// gamepos.transform.localScale = new Vector3(10, 1, 10);
|
||||||
break;
|
// break;
|
||||||
case 2:
|
// case 2:
|
||||||
gamepos.transform.localScale = new Vector3(20, 1, 20);
|
// gamepos.transform.localScale = new Vector3(20, 1, 20);
|
||||||
break;
|
// break;
|
||||||
case 3:
|
// case 3:
|
||||||
gamepos.transform.localScale = new Vector3(30, 1, 30);
|
// gamepos.transform.localScale = new Vector3(30, 1, 30);
|
||||||
break;
|
// break;
|
||||||
default:
|
// default:
|
||||||
break;
|
// break;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -382,7 +382,7 @@ public class RadarManger : MonoBehaviour
|
||||||
{
|
{
|
||||||
colliders = Physics.OverlapSphere(transform.position, detectionRadius).ToList(); // 检索范围内的所有碰撞体
|
colliders = Physics.OverlapSphere(transform.position, detectionRadius).ToList(); // 检索范围内的所有碰撞体
|
||||||
var colliders2 = colliders.FindAll(x => x.tag == "WRJ");
|
var colliders2 = colliders.FindAll(x => x.tag == "WRJ");
|
||||||
minCamera.orthographicSize = detectionRadius;
|
|
||||||
if (colliders2.Count > 0)
|
if (colliders2.Count > 0)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < colliders2.Count; i++)
|
for (int i = 0; i < colliders2.Count; i++)
|
||||||
|
@ -391,7 +391,7 @@ public class RadarManger : MonoBehaviour
|
||||||
if (unmannedAerialVehicle)
|
if (unmannedAerialVehicle)
|
||||||
{
|
{
|
||||||
bool isnearBlindArea = Vector3.Distance(transform.position, unmannedAerialVehicle.transform.position) > nearBlindArea;
|
bool isnearBlindArea = Vector3.Distance(transform.position, unmannedAerialVehicle.transform.position) > nearBlindArea;
|
||||||
if (isnearBlindArea)
|
if (!isnearBlindArea)
|
||||||
continue;
|
continue;
|
||||||
attackColliders1.Add(colliders[i]);
|
attackColliders1.Add(colliders[i]);
|
||||||
LaserFireControlPlatformManger laserFireControlPlatformManger = LaserFireControlPlatformManger.laserFireControlPlatformMangers.Find(x => (x != null&& x.isLasing == false&& x.lasertime <= 0));
|
LaserFireControlPlatformManger laserFireControlPlatformManger = LaserFireControlPlatformManger.laserFireControlPlatformMangers.Find(x => (x != null&& x.isLasing == false&& x.lasertime <= 0));
|
||||||
|
|
|
@ -183,6 +183,10 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
||||||
/// 地面层数
|
/// 地面层数
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public LayerMask Ground;
|
public LayerMask Ground;
|
||||||
|
/// <summary>
|
||||||
|
/// 改变频谱探测地图上显示点的大小
|
||||||
|
/// </summary>
|
||||||
|
public bool boisp = true;
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
gamePos.gameObject.SetActive(false);
|
gamePos.gameObject.SetActive(false);
|
||||||
|
@ -215,6 +219,7 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
||||||
if (reveal > 1)
|
if (reveal > 1)
|
||||||
{
|
{
|
||||||
gamePos.transform.localScale = new Vector3(reveal, 1, reveal);
|
gamePos.transform.localScale = new Vector3(reveal, 1, reveal);
|
||||||
|
boisp = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -350,12 +355,12 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Spectrumdetection.Radius > 0)
|
if (Spectrumdetection.Radius > 0 && boisp)
|
||||||
{
|
{
|
||||||
if (gxWRJCamera && dzWRJCamera)
|
//if (gxWRJCamera && dzWRJCamera)
|
||||||
{
|
//{
|
||||||
gxWRJCamera.orthographicSize = Spectrumdetection.Radius * 1000;
|
// //gxWRJCamera.orthographicSize = Spectrumdetection.Radius * 1000;
|
||||||
dzWRJCamera.orthographicSize = Spectrumdetection.Radius * 1000;
|
|
||||||
switch (Spectrumdetection.Radius)
|
switch (Spectrumdetection.Radius)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
|
@ -381,37 +386,37 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
}
|
//Judgingdistance();
|
||||||
Judgingdistance();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Judgingdistance()
|
//private void Judgingdistance()
|
||||||
{
|
//{
|
||||||
RaycastHit hit;
|
// RaycastHit hit;
|
||||||
//Debug.LogError("调用了");
|
// //Debug.LogError("调用了");
|
||||||
if (Physics.Raycast(transform.position, Vector3.down, out hit))
|
// if (Physics.Raycast(transform.position, Vector3.down, out hit))
|
||||||
{
|
// {
|
||||||
Debug.Log(hit.distance);
|
// Debug.Log(hit.distance);
|
||||||
if (hit.distance <= 1f)
|
// if (hit.distance <= 1f)
|
||||||
{
|
// {
|
||||||
if (gamemap && gamePos)
|
// if (gamemap && gamePos)
|
||||||
{
|
// {
|
||||||
gamePos.gameObject.SetActive(false);
|
// gamePos.gameObject.SetActive(false);
|
||||||
gamemap.gameObject.SetActive(false);
|
// gamemap.gameObject.SetActive(false);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
if (gamemap && gamePos)
|
// if (gamemap && gamePos)
|
||||||
{
|
// {
|
||||||
gamePos.gameObject.SetActive(true);
|
// gamePos.gameObject.SetActive(true);
|
||||||
gamemap.gameObject.SetActive(true);
|
// gamemap.gameObject.SetActive(true);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///上传日志
|
///上传日志
|
||||||
|
@ -1145,6 +1150,8 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
||||||
if (isMove && positions.Count > 0)
|
if (isMove && positions.Count > 0)
|
||||||
{
|
{
|
||||||
isMove = false;
|
isMove = false;
|
||||||
|
gamePos.gameObject.SetActive(true);
|
||||||
|
gamemap.gameObject.SetActive(true);
|
||||||
Vector3 _positions = positions.Dequeue();
|
Vector3 _positions = positions.Dequeue();
|
||||||
var nowData = GetSyncData(_positions);
|
var nowData = GetSyncData(_positions);
|
||||||
MyNetMQClient.instance.Send(nowData);
|
MyNetMQClient.instance.Send(nowData);
|
||||||
|
@ -1161,6 +1168,8 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public IEnumerator MoveObjectAlongPath(Vector3 _positions) // 协程:按路线移动物体
|
public IEnumerator MoveObjectAlongPath(Vector3 _positions) // 协程:按路线移动物体
|
||||||
{
|
{
|
||||||
|
gamePos.gameObject.SetActive(true);
|
||||||
|
gamemap.gameObject.SetActive(true);
|
||||||
Vector3 targetPosition = new Vector3(_positions.x, hight, _positions.z);// 目标位置为当前顶点坐标
|
Vector3 targetPosition = new Vector3(_positions.x, hight, _positions.z);// 目标位置为当前顶点坐标
|
||||||
float _distance = Vector3.Distance(transform.position, targetPosition);
|
float _distance = Vector3.Distance(transform.position, targetPosition);
|
||||||
float _time = _distance / FireSpeed;
|
float _time = _distance / FireSpeed;
|
||||||
|
|
|
@ -118,7 +118,7 @@ public class DroneViewDisplay : MonoSingleton<DroneViewDisplay>
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
/// 其他非无人机设备生成RenderTexture
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="deviceID"></param>
|
/// <param name="deviceID"></param>
|
||||||
/// <param name="camera"></param>
|
/// <param name="camera"></param>
|
||||||
|
|
Loading…
Reference in New Issue