相机修改
This commit is contained in:
parent
8f7834a79a
commit
eaba517950
|
@ -120,10 +120,10 @@ public class Spectrumdetection : MonoBehaviour
|
|||
{
|
||||
if (colliders[i].transform.gameObject.tag=="WRJ")
|
||||
{
|
||||
UnmannedAerialVehicleManage unmannedAerialVehicleManage = null;
|
||||
if (colliders[i].GetComponent<UnmannedAerialVehicleManage>())
|
||||
UnmannedAerialVehicle unmannedAerialVehicle = null;
|
||||
if (colliders[i].GetComponent<UnmannedAerialVehicle>())
|
||||
{
|
||||
unmannedAerialVehicleManage = colliders[i].GetComponent<UnmannedAerialVehicleManage>();
|
||||
unmannedAerialVehicle = colliders[i].GetComponent<UnmannedAerialVehicle>();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ RenderSettings:
|
|||
m_ReflectionIntensity: 1
|
||||
m_CustomReflection: {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
|
||||
--- !u!157 &3
|
||||
LightmapSettings:
|
||||
|
@ -106474,7 +106474,7 @@ MonoBehaviour:
|
|||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
randSeed: -2003133703
|
||||
randSeed: -1799708578
|
||||
isDoingTransition: 0
|
||||
minimumHeight: 0
|
||||
--- !u!114 &1820978574
|
||||
|
|
|
@ -208,11 +208,13 @@ public class GameManager : MonoSingleton<GameManager>
|
|||
//0 red 1 blue
|
||||
if (UIBootstrap.Instance.GetRoleByIDPracticeId(GlobalFlag.practiceSeatId) == "0")
|
||||
{
|
||||
spt.GetComponent<Camera>().cullingMask = ~(1 << 15);
|
||||
spt.gameObject.transform.position = redSpawnPos.position;
|
||||
spt.gameObject.transform.eulerAngles = redSpawnPos.eulerAngles;
|
||||
}
|
||||
else
|
||||
{
|
||||
spt.GetComponent<Camera>().cullingMask = ~(1 << 15);
|
||||
spt.gameObject.transform.position = blueSpawnPos.position;
|
||||
spt.gameObject.transform.eulerAngles = blueSpawnPos.eulerAngles;
|
||||
}
|
||||
|
|
|
@ -162,6 +162,7 @@ public class EquipmentCommon : MonoBehaviour
|
|||
case "蜂群无人机":
|
||||
UnmannedAerialVehicleManage unmannedAerialVehicleManage = GetComponent<UnmannedAerialVehicleManage>();
|
||||
unmannedAerialVehicleManage.FillInTheData(weaponitemone);
|
||||
unmannedAerialVehicleManage.MatrixFormation(30, 1);
|
||||
break;
|
||||
case "频谱探测":
|
||||
Spectrumdetection spectrumdetection = GetComponent<Spectrumdetection>();
|
||||
|
|
|
@ -9,6 +9,7 @@ using static InterfaceManager;
|
|||
using DG.Tweening.Core.Easing;
|
||||
using UnityEngine.EventSystems;
|
||||
using System;
|
||||
using Random = UnityEngine.Random;
|
||||
|
||||
/// <summary>
|
||||
/// 激光火控平台
|
||||
|
@ -309,13 +310,26 @@ public class LaserFireControlPlatformManger : MonoBehaviour
|
|||
|
||||
if (Receivingposin==null)
|
||||
{
|
||||
Receivingposin = unmannedAerialVehicle.transform;
|
||||
Debug.LogError("接收无人机的位置" + Receivingposin.position);
|
||||
var nowData = GetSyncData();
|
||||
_ = SyncCreateRoom.SendMessageAsync(string.Format("send2room {0}", nowData));
|
||||
isLasings = true;
|
||||
CastRayAndRender();
|
||||
break;
|
||||
//if (Random.value>0.5f)
|
||||
//{
|
||||
Receivingposin = unmannedAerialVehicle.transform;
|
||||
Debug.LogError("接收无人机的位置" + Receivingposin.position);
|
||||
var nowData = GetSyncData();
|
||||
_ = SyncCreateRoom.SendMessageAsync(string.Format("send2room {0}", nowData));
|
||||
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>
|
||||
/// 看向无人机
|
||||
|
@ -399,7 +418,7 @@ public class LaserFireControlPlatformManger : MonoBehaviour
|
|||
{
|
||||
targetPoint.position = new Vector3(targetPoint.position.x + 5, targetPoint.position.y, transform.position.z);
|
||||
LaserModer.transform.DOLookAt(targetPoint.position, 0.5f);
|
||||
CastRayAndRender1();
|
||||
//CastRayAndRender1();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
|
@ -421,12 +440,12 @@ public class LaserFireControlPlatformManger : MonoBehaviour
|
|||
if (InnerLaserlineRenderer)
|
||||
{
|
||||
InnerLaserlineRenderer.SetPosition(0, LaserPoint.transform.position); // 设置线段起点为物体位置
|
||||
InnerLaserlineRenderer.SetPosition(1, targetPoint.position); // 设置线段终点为目标点
|
||||
InnerLaserlineRenderer.SetPosition(1, Receivingposin.position); // 设置线段终点为目标点
|
||||
}
|
||||
if (OuterLaserlineRenderer)
|
||||
{
|
||||
InnerLaserlineRenderer.SetPosition(0, LaserPoint.transform.position); // 设置线段起点为物体位置
|
||||
InnerLaserlineRenderer.SetPosition(1, targetPoint.position); // 设置线段终点为目标点
|
||||
InnerLaserlineRenderer.SetPosition(1, Receivingposin.position); // 设置线段终点为目标点
|
||||
}
|
||||
StartCoroutine(LaserExtinction());
|
||||
}
|
||||
|
|
|
@ -130,6 +130,7 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
|||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
MatrixFormation(30, 1);
|
||||
for (int i = 0; i < unmannedAerialVehicles.Count; i++)
|
||||
{
|
||||
unmannedAerialVehicles[i].serialNumber = (i + 1).ToString();
|
||||
|
@ -248,7 +249,7 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
|||
for (int i = 0; i < colliders.Count; i++)
|
||||
{
|
||||
if (colliders[i].transform.tag == "AttackTarget")
|
||||
colliders1.Add(colliders[i]);
|
||||
colliders1.Add(colliders[i]);
|
||||
}
|
||||
if (colliders1.Count > 0)
|
||||
{
|
||||
|
@ -473,7 +474,7 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
|||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 无人机雁式阵型
|
||||
|
@ -550,7 +551,7 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
|||
/// <summary>
|
||||
/// 根据想定数据去设置无人机数量
|
||||
/// </summary>
|
||||
private void MatrixFormation(int rows, int wrjCount)
|
||||
public void MatrixFormation(int rows, int wrjCount)
|
||||
{
|
||||
for (int i = 0; i < unmannedAerialVehicles.Count; i++)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue