This commit is contained in:
parent
c982031369
commit
d6ff57f040
|
@ -1873,12 +1873,12 @@ Transform:
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 1767001470430300072}
|
m_GameObject: {fileID: 1767001470430300072}
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||||
m_LocalPosition: {x: 0, y: 10, z: 0}
|
m_LocalPosition: {x: -0.0023333232, y: 0.037733153, z: 0.06150008}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 0.083333336, y: 0.08333334, z: 0.083333336}
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 7615181139496386328}
|
m_Father: {fileID: 7615181138790815507}
|
||||||
m_RootOrder: 1
|
m_RootOrder: 6
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
--- !u!20 &5637926424441476190
|
--- !u!20 &5637926424441476190
|
||||||
Camera:
|
Camera:
|
||||||
|
@ -5370,7 +5370,7 @@ GameObject:
|
||||||
m_Layer: 12
|
m_Layer: 12
|
||||||
m_Name: Other
|
m_Name: Other
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: -5442936267250999957, guid: 0000000000000000d000000000000000, type: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
m_StaticEditorFlags: 0
|
m_StaticEditorFlags: 0
|
||||||
m_IsActive: 1
|
m_IsActive: 1
|
||||||
|
@ -9973,7 +9973,7 @@ Transform:
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 7615181138790815506}
|
m_GameObject: {fileID: 7615181138790815506}
|
||||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
m_LocalRotation: {x: -0.17364825, y: 0, z: 0, w: 0.9848078}
|
||||||
m_LocalPosition: {x: 0, y: 0.07360001, z: 0}
|
m_LocalPosition: {x: 0, y: 0.07360001, z: 0}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_Children:
|
m_Children:
|
||||||
|
@ -9983,9 +9983,10 @@ Transform:
|
||||||
- {fileID: 5745786961250802974}
|
- {fileID: 5745786961250802974}
|
||||||
- {fileID: 6067751846787327398}
|
- {fileID: 6067751846787327398}
|
||||||
- {fileID: 7615181139587479108}
|
- {fileID: 7615181139587479108}
|
||||||
|
- {fileID: 459346150931969862}
|
||||||
m_Father: {fileID: 3511568331994086970}
|
m_Father: {fileID: 3511568331994086970}
|
||||||
m_RootOrder: 0
|
m_RootOrder: 0
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: -20, y: 0, z: 0}
|
||||||
--- !u!1 &7615181139496386322
|
--- !u!1 &7615181139496386322
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
@ -10021,7 +10022,6 @@ Transform:
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_Children:
|
m_Children:
|
||||||
- {fileID: 3511568331994086970}
|
- {fileID: 3511568331994086970}
|
||||||
- {fileID: 459346150931969862}
|
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_RootOrder: 0
|
m_RootOrder: 0
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
@ -10041,6 +10041,7 @@ MonoBehaviour:
|
||||||
selectedSide: 1
|
selectedSide: 1
|
||||||
equipmentType: "\u6FC0\u5149\u706B\u63A7\u5E73\u53F0"
|
equipmentType: "\u6FC0\u5149\u706B\u63A7\u5E73\u53F0"
|
||||||
deviceID:
|
deviceID:
|
||||||
|
ISPlayer: 0
|
||||||
explodePrefab: {fileID: 1000013462590818, guid: ecdd96beb7f93494880c052dfccf9dc1,
|
explodePrefab: {fileID: 1000013462590818, guid: ecdd96beb7f93494880c052dfccf9dc1,
|
||||||
type: 3}
|
type: 3}
|
||||||
isMove: 1
|
isMove: 1
|
||||||
|
@ -10104,13 +10105,16 @@ MonoBehaviour:
|
||||||
FireSpeed: 20
|
FireSpeed: 20
|
||||||
explodePrefab: {fileID: 1000013462590818, guid: ecdd96beb7f93494880c052dfccf9dc1,
|
explodePrefab: {fileID: 1000013462590818, guid: ecdd96beb7f93494880c052dfccf9dc1,
|
||||||
type: 3}
|
type: 3}
|
||||||
camera: {fileID: 0}
|
camera: {fileID: 5637926424441476190}
|
||||||
RawImage: {fileID: 6102700022742998670, guid: b2cb817bb62743a4194cd9d89f07e27d,
|
RawImage: {fileID: 6102700022742998670, guid: b2cb817bb62743a4194cd9d89f07e27d,
|
||||||
type: 3}
|
type: 3}
|
||||||
crosshair: {fileID: 0}
|
crosshair: {fileID: 0}
|
||||||
Front: 1
|
Front: 1
|
||||||
Detection: {fileID: 3494968556799403172, guid: c20b9fea41a9bce4e8780bab3d0e13f9,
|
Detection: {fileID: 3494968556799403172, guid: c20b9fea41a9bce4e8780bab3d0e13f9,
|
||||||
type: 3}
|
type: 3}
|
||||||
|
isplaser: 1
|
||||||
|
lasertimes: 0
|
||||||
|
ispcamera: 0
|
||||||
--- !u!114 &7615181139496386323
|
--- !u!114 &7615181139496386323
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
@ -42,10 +42,7 @@ public class LaserFireControlPlatformManger : MonoBehaviour
|
||||||
/// 布尔值变化时触发的事件
|
/// 布尔值变化时触发的事件
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public event System.Action<bool> OnActivationChanged;
|
public event System.Action<bool> OnActivationChanged;
|
||||||
/// <summary>
|
|
||||||
/// 协程对象
|
|
||||||
/// </summary>
|
|
||||||
private Coroutine coroutinetime;
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 定时器运行状态
|
/// 定时器运行状态
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -144,8 +141,12 @@ public class LaserFireControlPlatformManger : MonoBehaviour
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 激光火炮打击时间
|
/// 激光火炮打击时间
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static float lasertime;
|
public float lasertime;
|
||||||
public float lasertimes;
|
/// <summary>
|
||||||
|
/// 激光火炮打击时间
|
||||||
|
/// </summary>
|
||||||
|
public float storageIntervalTime;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 判断物体是否在相机里面
|
/// 判断物体是否在相机里面
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -154,11 +155,7 @@ public class LaserFireControlPlatformManger : MonoBehaviour
|
||||||
{
|
{
|
||||||
equipmentCommon = GetComponent<EquipmentCommon>();
|
equipmentCommon = GetComponent<EquipmentCommon>();
|
||||||
laserFireControlPlatformMangers.Add(this);
|
laserFireControlPlatformMangers.Add(this);
|
||||||
camera = transform.GetChild(1).GetComponent<Camera>();
|
|
||||||
//weaponitemones = Newtonsoft.Json.JsonConvert.DeserializeObject<Weaponitemone>(msg);
|
|
||||||
//FillInTheData(weaponitemones);//测试写入
|
|
||||||
// 订阅布尔值变化事件
|
|
||||||
OnActivationChanged += OnActivationChangedHandler;
|
|
||||||
//生成激光
|
//生成激光
|
||||||
GameObject _InnerLaserlineRenderer = Instantiate(InnerLaserlineRendererPrefab);
|
GameObject _InnerLaserlineRenderer = Instantiate(InnerLaserlineRendererPrefab);
|
||||||
_InnerLaserlineRenderer.transform.position = Vector3.zero;
|
_InnerLaserlineRenderer.transform.position = Vector3.zero;
|
||||||
|
@ -175,7 +172,6 @@ public class LaserFireControlPlatformManger : MonoBehaviour
|
||||||
|
|
||||||
GameObject _OuterLaserlineRenderer = Instantiate(OuterLaserlineRendererPrefab);
|
GameObject _OuterLaserlineRenderer = Instantiate(OuterLaserlineRendererPrefab);
|
||||||
_OuterLaserlineRenderer.transform.position = Vector3.zero;
|
_OuterLaserlineRenderer.transform.position = Vector3.zero;
|
||||||
//_OuterLaserlineRenderer.transform.SetParent(transform);
|
|
||||||
OuterLaserlineRenderer = _OuterLaserlineRenderer.GetComponent<LineRenderer>();
|
OuterLaserlineRenderer = _OuterLaserlineRenderer.GetComponent<LineRenderer>();
|
||||||
if (OuterLaserlineRenderer)
|
if (OuterLaserlineRenderer)
|
||||||
{
|
{
|
||||||
|
@ -188,22 +184,7 @@ public class LaserFireControlPlatformManger : MonoBehaviour
|
||||||
|
|
||||||
void Update()
|
void Update()
|
||||||
{
|
{
|
||||||
if (lasertime > 0)
|
lasertime -= Time.deltaTime;
|
||||||
{
|
|
||||||
lasertime -= Time.deltaTime;
|
|
||||||
if (lasertime <= 0)
|
|
||||||
{
|
|
||||||
lasertime = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//if (UIBootstrap.Instance.GetRoleByIDPracticeId(GlobalFlag.practiceSeatId) != "0"&&Input.GetMouseButtonDown(0))
|
|
||||||
//{
|
|
||||||
// if (!EventSystem.current.IsPointerOverGameObject())
|
|
||||||
// {
|
|
||||||
// Destroy(crosshair.gameObject);
|
|
||||||
// Front = true;
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
if (UIBootstrap.Instance.GetRoleByIDPracticeId(GlobalFlag.practiceSeatId) != "0" && Input.GetMouseButtonDown(0))
|
if (UIBootstrap.Instance.GetRoleByIDPracticeId(GlobalFlag.practiceSeatId) != "0" && Input.GetMouseButtonDown(0))
|
||||||
{
|
{
|
||||||
|
@ -228,60 +209,7 @@ public class LaserFireControlPlatformManger : MonoBehaviour
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 开启暂停激光发射武器
|
|
||||||
/// </summary>
|
|
||||||
void OnActivationChangedHandler(bool bos)
|
|
||||||
{
|
|
||||||
if (bos)
|
|
||||||
{
|
|
||||||
Debug.LogError("开启协程");
|
|
||||||
starttimer();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Debug.LogError("暂停协程");
|
|
||||||
stoptimer();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 开启协程
|
|
||||||
/// </summary>
|
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
|
||||||
private void starttimer()
|
|
||||||
{
|
|
||||||
if (equipmentCommon.isPlayer && coroutinetime == null)
|
|
||||||
{
|
|
||||||
coroutinetime = StartCoroutine(Timer());
|
|
||||||
islaser = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// 关闭协程
|
|
||||||
/// </summary>
|
|
||||||
private void stoptimer()
|
|
||||||
{
|
|
||||||
if (equipmentCommon.isPlayer && coroutinetime != null)
|
|
||||||
{
|
|
||||||
StopCoroutine(coroutinetime);
|
|
||||||
islaser = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// 协程
|
|
||||||
/// </summary>
|
|
||||||
IEnumerator Timer()
|
|
||||||
{
|
|
||||||
while (true)
|
|
||||||
{
|
|
||||||
yield return new WaitForSeconds(lasertime);
|
|
||||||
if (lasertime != 0)
|
|
||||||
{
|
|
||||||
//Laserattack();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
void LateUpdate()
|
void LateUpdate()
|
||||||
{
|
{
|
||||||
if (Receivingdistance > 0 && isplaser == true)
|
if (Receivingdistance > 0 && isplaser == true)
|
||||||
|
@ -308,7 +236,7 @@ public class LaserFireControlPlatformManger : MonoBehaviour
|
||||||
case "储能间隔时间:":
|
case "储能间隔时间:":
|
||||||
StorageIntervalTime = weaponitemone[i].para_value;
|
StorageIntervalTime = weaponitemone[i].para_value;
|
||||||
lasertime = float.Parse(StorageIntervalTime);
|
lasertime = float.Parse(StorageIntervalTime);
|
||||||
lasertimes = float.Parse(StorageIntervalTime);
|
storageIntervalTime = float.Parse(StorageIntervalTime);
|
||||||
break;
|
break;
|
||||||
case "毁伤目标累积作用时间:":
|
case "毁伤目标累积作用时间:":
|
||||||
CumulativeActionTimeOfDamageTarget = weaponitemone[i].para_value;
|
CumulativeActionTimeOfDamageTarget = weaponitemone[i].para_value;
|
||||||
|
@ -327,66 +255,6 @@ public class LaserFireControlPlatformManger : MonoBehaviour
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
///// <summary>
|
|
||||||
///// 激光发起攻击
|
|
||||||
///// </summary>
|
|
||||||
//public void Laserattack()
|
|
||||||
//{
|
|
||||||
// if (Receivingdistance > 0 && targetPoint != null)
|
|
||||||
// {
|
|
||||||
// Collider[] colliders = Physics.OverlapSphere(transform.position, Receivingdistance);//检查是否在打击的范围内
|
|
||||||
// for (int i = 0; i < colliders.Length; i++)
|
|
||||||
// {
|
|
||||||
// if (colliders[i].gameObject.tag == "WRJ")
|
|
||||||
// {
|
|
||||||
// UnmannedAerialVehicle unmannedAerialVehicle = null;
|
|
||||||
// if (colliders[i].GetComponent<UnmannedAerialVehicle>())
|
|
||||||
// {
|
|
||||||
// unmannedAerialVehicle = colliders[i].GetComponent<UnmannedAerialVehicle>();
|
|
||||||
// }
|
|
||||||
// if (unmannedAerialVehicle != null)
|
|
||||||
// {
|
|
||||||
// Vector3 Angle = unmannedAerialVehicle.transform.position - transform.position;
|
|
||||||
// float Angle1 = Vector3.Angle(Angle, transform.forward);
|
|
||||||
// Debug.LogError("角度大小:" + Angle1);
|
|
||||||
// if (float.Parse(InterferenceAngle) >= Angle1)
|
|
||||||
// {
|
|
||||||
// Debug.LogError("角度没有问题进来了" + InterferenceAngle);
|
|
||||||
|
|
||||||
// if (Receivingposin == null)
|
|
||||||
// {
|
|
||||||
// //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;
|
|
||||||
|
|
||||||
// //}
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
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,31 +267,28 @@ public class LaserFireControlPlatformManger : MonoBehaviour
|
||||||
LaserModer.transform.DOLookAt(targetPoint.position, 0.5f).OnComplete(() =>
|
LaserModer.transform.DOLookAt(targetPoint.position, 0.5f).OnComplete(() =>
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
//var nowData = GetSyncData();
|
|
||||||
//_ = SyncCreateRoom.SendMessageAsync(string.Format("send2room {0}", nowData));
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Debug.LogError("没有目标");
|
Debug.LogError("没有目标");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/// <summary>
|
///// <summary>
|
||||||
/// 十字准星架视角
|
///// 十字准星架视角
|
||||||
/// </summary>
|
///// </summary>
|
||||||
public void Crosshair()
|
//public void Crosshair()
|
||||||
{
|
//{
|
||||||
if (targetPoint != null)
|
// if (targetPoint != null)
|
||||||
{
|
// {
|
||||||
camera.transform.DOLookAt(targetPoint.position, 0.5f).SetEase(Ease.Linear).OnComplete(() =>
|
// camera.transform.DOLookAt(targetPoint.position, 0.5f).SetEase(Ease.Linear).OnComplete(() =>
|
||||||
{
|
// {
|
||||||
Debug.LogError("看向进来了");
|
// Debug.LogError("看向进来了");
|
||||||
Launchanattack();
|
// Launchanattack();
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
//}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 激光显示
|
/// 激光显示
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -560,10 +425,6 @@ 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); // 设置线段终点为目标点
|
||||||
}
|
}
|
||||||
if (lasertimes == 0)
|
|
||||||
{
|
|
||||||
lasertime = lasertimes;
|
|
||||||
}
|
|
||||||
isLasing = false;
|
isLasing = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -606,21 +467,7 @@ public class LaserFireControlPlatformManger : MonoBehaviour
|
||||||
StartCoroutine(LaserExtinction());
|
StartCoroutine(LaserExtinction());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
/// <summary>
|
|
||||||
/// 检查鼠标是否进入物体
|
|
||||||
/// </summary>
|
|
||||||
public void OnMouseEnter()
|
|
||||||
{
|
|
||||||
//if (UIBootstrap.Instance.GetRoleByIDPracticeId(GlobalFlag.practiceSeatId) != "0")
|
|
||||||
//{
|
|
||||||
// Transform Canvas = GameObject.Find("Canvas").transform;
|
|
||||||
// if (Canvas && Front)
|
|
||||||
// {
|
|
||||||
// crosshair = Instantiate(RawImage, Canvas);
|
|
||||||
// crosshair.transform.position = Camera.main.WorldToScreenPoint(transform.position);
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
}
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 检查鼠标是否离开物体
|
/// 检查鼠标是否离开物体
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -635,6 +482,5 @@ public class LaserFireControlPlatformManger : MonoBehaviour
|
||||||
Destroy(InnerLaserlineRenderer.gameObject);
|
Destroy(InnerLaserlineRenderer.gameObject);
|
||||||
if (OuterLaserlineRenderer != null)
|
if (OuterLaserlineRenderer != null)
|
||||||
Destroy(OuterLaserlineRenderer.gameObject);
|
Destroy(OuterLaserlineRenderer.gameObject);
|
||||||
OnActivationChanged -= OnActivationChangedHandler;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -121,7 +121,7 @@ public class RadarManger : MonoBehaviour
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 计时火炮蓄能时间
|
/// 计时火炮蓄能时间
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public float radartime=0;
|
//public float radartime=0;
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
Mincamera = GameObject.Find("Minimap Camera").GetComponent<Camera>();
|
Mincamera = GameObject.Find("Minimap Camera").GetComponent<Camera>();
|
||||||
|
@ -296,7 +296,6 @@ public class RadarManger : MonoBehaviour
|
||||||
public void RetrievalUAV()
|
public void RetrievalUAV()
|
||||||
{
|
{
|
||||||
List<Collider> colliders = Physics.OverlapSphere(transform.position, detectionRadius).ToList(); // 检索范围内的所有碰撞体
|
List<Collider> colliders = Physics.OverlapSphere(transform.position, detectionRadius).ToList(); // 检索范围内的所有碰撞体
|
||||||
int number = 0;
|
|
||||||
var colliders2 = colliders.FindAll(x => x.tag == "WRJ");
|
var colliders2 = colliders.FindAll(x => x.tag == "WRJ");
|
||||||
Mincamera.orthographicSize = detectionRadius;
|
Mincamera.orthographicSize = detectionRadius;
|
||||||
if (colliders2.Count > 0)
|
if (colliders2.Count > 0)
|
||||||
|
@ -306,25 +305,16 @@ public class RadarManger : MonoBehaviour
|
||||||
UnmannedAerialVehicle unmannedAerialVehicle = colliders2[i].GetComponent<UnmannedAerialVehicle>();
|
UnmannedAerialVehicle unmannedAerialVehicle = colliders2[i].GetComponent<UnmannedAerialVehicle>();
|
||||||
if (unmannedAerialVehicle)
|
if (unmannedAerialVehicle)
|
||||||
{
|
{
|
||||||
if (radartime == LaserFireControlPlatformManger.lasertime)
|
LaserFireControlPlatformManger laserFireControlPlatformManger = LaserFireControlPlatformManger.laserFireControlPlatformMangers.Find(x => (x != null && x.isLasing == false && x.lasertime <= 0));
|
||||||
|
if (laserFireControlPlatformManger)
|
||||||
{
|
{
|
||||||
Debug.Log("今来了");
|
laserFireControlPlatformManger.lasertime = laserFireControlPlatformManger.storageIntervalTime;
|
||||||
LaserFireControlPlatformManger laserFireControlPlatformManger = LaserFireControlPlatformManger.laserFireControlPlatformMangers.Find(x => (x != null && x.isLasing == false));
|
laserFireControlPlatformManger.isLasing = true;
|
||||||
if (laserFireControlPlatformManger)
|
laserFireControlPlatformManger.targetPoint = unmannedAerialVehicle.transform;
|
||||||
{
|
laserFireControlPlatformManger.Lasing();
|
||||||
laserFireControlPlatformManger.isLasing = true;
|
|
||||||
//Debug.Log(laserFireControlPlatformManger.transform.name + "攻击无人机: " + unmannedAerialVehicle.transform.name);
|
|
||||||
laserFireControlPlatformManger.targetPoint = unmannedAerialVehicle.transform;
|
|
||||||
laserFireControlPlatformManger.Crosshair();
|
|
||||||
laserFireControlPlatformManger.Lasing();
|
|
||||||
radartime = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
number++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue