Merge branch 'master' of http://git.umayle.com:2023/yulong/NewN_UAVPlane
This commit is contained in:
commit
da8a13cf40
|
@ -120,10 +120,10 @@ public class Spectrumdetection : MonoBehaviour
|
||||||
{
|
{
|
||||||
if (colliders[i].transform.gameObject.tag=="WRJ")
|
if (colliders[i].transform.gameObject.tag=="WRJ")
|
||||||
{
|
{
|
||||||
UnmannedAerialVehicleManage unmannedAerialVehicleManage = null;
|
UnmannedAerialVehicle unmannedAerialVehicle = null;
|
||||||
if (colliders[i].GetComponent<UnmannedAerialVehicleManage>())
|
if (colliders[i].GetComponent<UnmannedAerialVehicle>())
|
||||||
{
|
{
|
||||||
unmannedAerialVehicleManage = colliders[i].GetComponent<UnmannedAerialVehicleManage>();
|
unmannedAerialVehicle = colliders[i].GetComponent<UnmannedAerialVehicle>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ RenderSettings:
|
||||||
m_ReflectionIntensity: 1
|
m_ReflectionIntensity: 1
|
||||||
m_CustomReflection: {fileID: 0}
|
m_CustomReflection: {fileID: 0}
|
||||||
m_Sun: {fileID: 0}
|
m_Sun: {fileID: 0}
|
||||||
m_IndirectSpecularColor: {r: 0.16521391, g: 0.30764452, b: 0.6578343, a: 1}
|
m_IndirectSpecularColor: {r: 0.1652264, g: 0.30731973, b: 0.6559837, a: 1}
|
||||||
m_UseRadianceAmbientProbe: 0
|
m_UseRadianceAmbientProbe: 0
|
||||||
--- !u!157 &3
|
--- !u!157 &3
|
||||||
LightmapSettings:
|
LightmapSettings:
|
||||||
|
@ -106474,7 +106474,7 @@ MonoBehaviour:
|
||||||
m_PreInfinity: 2
|
m_PreInfinity: 2
|
||||||
m_PostInfinity: 2
|
m_PostInfinity: 2
|
||||||
m_RotationOrder: 4
|
m_RotationOrder: 4
|
||||||
randSeed: -2003133703
|
randSeed: -1799708578
|
||||||
isDoingTransition: 0
|
isDoingTransition: 0
|
||||||
minimumHeight: 0
|
minimumHeight: 0
|
||||||
--- !u!114 &1820978574
|
--- !u!114 &1820978574
|
||||||
|
|
|
@ -208,11 +208,13 @@ public class GameManager : MonoSingleton<GameManager>
|
||||||
//0 red 1 blue
|
//0 red 1 blue
|
||||||
if (UIBootstrap.Instance.GetRoleByIDPracticeId(GlobalFlag.practiceSeatId) == "0")
|
if (UIBootstrap.Instance.GetRoleByIDPracticeId(GlobalFlag.practiceSeatId) == "0")
|
||||||
{
|
{
|
||||||
|
spt.GetComponent<Camera>().cullingMask = ~(1 << 15);
|
||||||
spt.gameObject.transform.position = redSpawnPos.position;
|
spt.gameObject.transform.position = redSpawnPos.position;
|
||||||
spt.gameObject.transform.eulerAngles = redSpawnPos.eulerAngles;
|
spt.gameObject.transform.eulerAngles = redSpawnPos.eulerAngles;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
spt.GetComponent<Camera>().cullingMask = ~(1 << 15);
|
||||||
spt.gameObject.transform.position = blueSpawnPos.position;
|
spt.gameObject.transform.position = blueSpawnPos.position;
|
||||||
spt.gameObject.transform.eulerAngles = blueSpawnPos.eulerAngles;
|
spt.gameObject.transform.eulerAngles = blueSpawnPos.eulerAngles;
|
||||||
}
|
}
|
||||||
|
|
|
@ -162,6 +162,7 @@ public class EquipmentCommon : MonoBehaviour
|
||||||
case "蜂群无人机":
|
case "蜂群无人机":
|
||||||
UnmannedAerialVehicleManage unmannedAerialVehicleManage = GetComponent<UnmannedAerialVehicleManage>();
|
UnmannedAerialVehicleManage unmannedAerialVehicleManage = GetComponent<UnmannedAerialVehicleManage>();
|
||||||
unmannedAerialVehicleManage.FillInTheData(weaponitemone);
|
unmannedAerialVehicleManage.FillInTheData(weaponitemone);
|
||||||
|
unmannedAerialVehicleManage.MatrixFormation(30, 1);
|
||||||
break;
|
break;
|
||||||
case "频谱探测":
|
case "频谱探测":
|
||||||
Spectrumdetection spectrumdetection = GetComponent<Spectrumdetection>();
|
Spectrumdetection spectrumdetection = GetComponent<Spectrumdetection>();
|
||||||
|
|
|
@ -9,6 +9,7 @@ using static InterfaceManager;
|
||||||
using DG.Tweening.Core.Easing;
|
using DG.Tweening.Core.Easing;
|
||||||
using UnityEngine.EventSystems;
|
using UnityEngine.EventSystems;
|
||||||
using System;
|
using System;
|
||||||
|
using Random = UnityEngine.Random;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 激光火控平台
|
/// 激光火控平台
|
||||||
|
@ -309,13 +310,26 @@ public class LaserFireControlPlatformManger : MonoBehaviour
|
||||||
|
|
||||||
if (Receivingposin==null)
|
if (Receivingposin==null)
|
||||||
{
|
{
|
||||||
Receivingposin = unmannedAerialVehicle.transform;
|
//if (Random.value>0.5f)
|
||||||
Debug.LogError("接收无人机的位置" + Receivingposin.position);
|
//{
|
||||||
var nowData = GetSyncData();
|
Receivingposin = unmannedAerialVehicle.transform;
|
||||||
_ = SyncCreateRoom.SendMessageAsync(string.Format("send2room {0}", nowData));
|
Debug.LogError("接收无人机的位置" + Receivingposin.position);
|
||||||
isLasings = true;
|
var nowData = GetSyncData();
|
||||||
CastRayAndRender();
|
_ = SyncCreateRoom.SendMessageAsync(string.Format("send2room {0}", nowData));
|
||||||
break;
|
isLasings = true;
|
||||||
|
CastRayAndRender();
|
||||||
|
break;
|
||||||
|
//}
|
||||||
|
//else
|
||||||
|
//{
|
||||||
|
// Receivingposin = unmannedAerialVehicle.transform;
|
||||||
|
// var nowData1= GetSyncData1();
|
||||||
|
// _ = SyncCreateRoom.SendMessageAsync(string.Format("send2room {0}", nowData1));
|
||||||
|
// isLasings = true;
|
||||||
|
// CastRayAndRender1();
|
||||||
|
// break;
|
||||||
|
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -324,6 +338,11 @@ public class LaserFireControlPlatformManger : MonoBehaviour
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private string GetSyncData1()
|
||||||
|
{
|
||||||
|
return string.Format("{0},{1},{2},{3}" + equipmentCommon.deviceID, Receivingposin.position.x+3,Receivingposin.position.y+3,Receivingposin.position.z);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 看向无人机
|
/// 看向无人机
|
||||||
|
@ -399,7 +418,7 @@ public class LaserFireControlPlatformManger : MonoBehaviour
|
||||||
{
|
{
|
||||||
targetPoint.position = new Vector3(targetPoint.position.x + 5, targetPoint.position.y, transform.position.z);
|
targetPoint.position = new Vector3(targetPoint.position.x + 5, targetPoint.position.y, transform.position.z);
|
||||||
LaserModer.transform.DOLookAt(targetPoint.position, 0.5f);
|
LaserModer.transform.DOLookAt(targetPoint.position, 0.5f);
|
||||||
CastRayAndRender1();
|
//CastRayAndRender1();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -421,12 +440,12 @@ public class LaserFireControlPlatformManger : MonoBehaviour
|
||||||
if (InnerLaserlineRenderer)
|
if (InnerLaserlineRenderer)
|
||||||
{
|
{
|
||||||
InnerLaserlineRenderer.SetPosition(0, LaserPoint.transform.position); // 设置线段起点为物体位置
|
InnerLaserlineRenderer.SetPosition(0, LaserPoint.transform.position); // 设置线段起点为物体位置
|
||||||
InnerLaserlineRenderer.SetPosition(1, targetPoint.position); // 设置线段终点为目标点
|
InnerLaserlineRenderer.SetPosition(1, Receivingposin.position); // 设置线段终点为目标点
|
||||||
}
|
}
|
||||||
if (OuterLaserlineRenderer)
|
if (OuterLaserlineRenderer)
|
||||||
{
|
{
|
||||||
InnerLaserlineRenderer.SetPosition(0, LaserPoint.transform.position); // 设置线段起点为物体位置
|
InnerLaserlineRenderer.SetPosition(0, LaserPoint.transform.position); // 设置线段起点为物体位置
|
||||||
InnerLaserlineRenderer.SetPosition(1, targetPoint.position); // 设置线段终点为目标点
|
InnerLaserlineRenderer.SetPosition(1, Receivingposin.position); // 设置线段终点为目标点
|
||||||
}
|
}
|
||||||
StartCoroutine(LaserExtinction());
|
StartCoroutine(LaserExtinction());
|
||||||
}
|
}
|
||||||
|
|
|
@ -137,6 +137,7 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
||||||
// Start is called before the first frame update
|
// Start is called before the first frame update
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
|
MatrixFormation(30, 1);
|
||||||
for (int i = 0; i < unmannedAerialVehicles.Count; i++)
|
for (int i = 0; i < unmannedAerialVehicles.Count; i++)
|
||||||
{
|
{
|
||||||
unmannedAerialVehicles[i].serialNumber = (i + 1).ToString();
|
unmannedAerialVehicles[i].serialNumber = (i + 1).ToString();
|
||||||
|
@ -576,7 +577,7 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 根据想定数据去设置无人机数量
|
/// 根据想定数据去设置无人机数量
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void MatrixFormation(int rows, int wrjCount)
|
public void MatrixFormation(int rows, int wrjCount)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < unmannedAerialVehicles.Count; i++)
|
for (int i = 0; i < unmannedAerialVehicles.Count; i++)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue