ppp
This commit is contained in:
commit
935442e7d1
|
@ -10104,7 +10104,7 @@ MonoBehaviour:
|
||||||
FireSpeed: 20
|
FireSpeed: 20
|
||||||
explodePrefab: {fileID: 1000013462590818, guid: ecdd96beb7f93494880c052dfccf9dc1,
|
explodePrefab: {fileID: 1000013462590818, guid: ecdd96beb7f93494880c052dfccf9dc1,
|
||||||
type: 3}
|
type: 3}
|
||||||
Camera: {fileID: 0}
|
camera: {fileID: 0}
|
||||||
RawImage: {fileID: 6102700022742998670, guid: b2cb817bb62743a4194cd9d89f07e27d,
|
RawImage: {fileID: 6102700022742998670, guid: b2cb817bb62743a4194cd9d89f07e27d,
|
||||||
type: 3}
|
type: 3}
|
||||||
crosshair: {fileID: 0}
|
crosshair: {fileID: 0}
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
/// <summary>
|
||||||
|
/// 电子侦察无人机
|
||||||
|
/// </summary>
|
||||||
|
public class ElectronicReconnaissanceDrone : UAVBase
|
||||||
|
{
|
||||||
|
// Start is called before the first frame update
|
||||||
|
void Start()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update is called once per frame
|
||||||
|
void Update()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: ddc1db5913d56ec47ac93953631c9a82
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -0,0 +1,27 @@
|
||||||
|
using PData;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 无人机基类
|
||||||
|
/// </summary>
|
||||||
|
public class UAVBase : MonoBehaviour
|
||||||
|
{
|
||||||
|
public void GetWeatherAttachUAV()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
public void SetWeatherValue()
|
||||||
|
{
|
||||||
|
SenceInfo currentSceneInfo = new SenceInfo();
|
||||||
|
currentSceneInfo = UIBootstrap.Instance.currentSceneInfo.data;
|
||||||
|
|
||||||
|
//tenkokuModule.weather_RainAmt = Mathf.Lerp(0f, 1f, float.Parse(currentSceneInfo.EnvRain));
|
||||||
|
//tenkokuModule.weather_SnowAmt = Mathf.Lerp(0f, 1f, float.Parse(currentSceneInfo.EnvSnow));
|
||||||
|
//tenkokuModule.weather_WindAmt = Mathf.Lerp(0f, 1f, float.Parse(currentSceneInfo.EnvWindSpeed));
|
||||||
|
//tenkokuModule.weather_WindDir = Mathf.Lerp(0f, 360f, float.Parse(currentSceneInfo.EnvWindDir));
|
||||||
|
//tenkokuModule.weather_OvercastAmt = Mathf.Lerp(0f, 1f, 1 - (float.Parse(currentSceneInfo.EnvLight) / 10));
|
||||||
|
//tenkokuModule.weather_humidity = Mathf.Lerp(0f, 1f, 1 - (float.Parse(currentSceneInfo.EnvWu) / 100));
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 1acac6355624a274ea601506c5f2a3ff
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -1,5 +1,6 @@
|
||||||
using AdamSync;
|
using AdamSync;
|
||||||
using AdamThinkDevicesData;
|
using AdamThinkDevicesData;
|
||||||
|
using PData;
|
||||||
using RDate;
|
using RDate;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
|
@ -419,14 +420,14 @@ public class GameManager : MonoSingleton<GameManager>
|
||||||
|
|
||||||
public void SetWeatherValue()
|
public void SetWeatherValue()
|
||||||
{
|
{
|
||||||
tenkokuModule.weather_RainAmt = Mathf.Lerp(0f, 1f, float.Parse(UIBootstrap.Instance.currentSceneInfo.data.EnvRain));
|
SenceInfo currentSceneInfo = new SenceInfo();
|
||||||
tenkokuModule.weather_SnowAmt = Mathf.Lerp(0f, 1f, float.Parse(UIBootstrap.Instance.currentSceneInfo.data.EnvSnow));
|
currentSceneInfo = UIBootstrap.Instance.currentSceneInfo.data;
|
||||||
tenkokuModule.weather_WindAmt = Mathf.Lerp(0f, 1f, float.Parse(UIBootstrap.Instance.currentSceneInfo.data.EnvWindSpeed));
|
tenkokuModule.weather_RainAmt = Mathf.Lerp(0f, 1f, float.Parse(currentSceneInfo.EnvRain));
|
||||||
tenkokuModule.weather_WindDir = Mathf.Lerp(0f, 360f, float.Parse(UIBootstrap.Instance.currentSceneInfo.data.EnvWindDir));
|
tenkokuModule.weather_SnowAmt = Mathf.Lerp(0f, 1f, float.Parse(currentSceneInfo.EnvSnow));
|
||||||
tenkokuModule.weather_OvercastAmt = Mathf.Lerp(0f, 1f, 1 - (float.Parse(UIBootstrap.Instance.currentSceneInfo.data.EnvLight) / 10));
|
tenkokuModule.weather_WindAmt = Mathf.Lerp(0f, 1f, float.Parse(currentSceneInfo.EnvWindSpeed));
|
||||||
tenkokuModule.weather_humidity = Mathf.Lerp(0f, 1f, 1 - (float.Parse(UIBootstrap.Instance.currentSceneInfo.data.EnvWu) / 100));
|
tenkokuModule.weather_WindDir = Mathf.Lerp(0f, 360f, float.Parse(currentSceneInfo.EnvWindDir));
|
||||||
Debug.LogError(tenkokuModule.weather_humidity);
|
tenkokuModule.weather_OvercastAmt = Mathf.Lerp(0f, 1f, 1 - (float.Parse(currentSceneInfo.EnvLight) / 10));
|
||||||
Debug.LogError(tenkokuModule.weather_OvercastAmt);
|
tenkokuModule.weather_humidity = Mathf.Lerp(0f, 1f, 1 - (float.Parse(currentSceneInfo.EnvWu) / 100));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -133,6 +133,7 @@ public class EquipmentCommon : MonoBehaviour
|
||||||
replaceInfoDic.Add("device_name", equipmentCommon.equipmentType);
|
replaceInfoDic.Add("device_name", equipmentCommon.equipmentType);
|
||||||
replaceInfoDic.Add("para_list", paraListJson);
|
replaceInfoDic.Add("para_list", paraListJson);
|
||||||
replaceInfoDic.Add("r1", $"{transform.position.x},{transform.position.y},{transform.position.z},{transform.eulerAngles.x},{transform.eulerAngles.y},{transform.eulerAngles.z}");
|
replaceInfoDic.Add("r1", $"{transform.position.x},{transform.position.y},{transform.position.z},{transform.eulerAngles.x},{transform.eulerAngles.y},{transform.eulerAngles.z}");
|
||||||
|
if (gameObject.GetComponent<UnmannedAerialVehicleManage>())
|
||||||
replaceInfoDic.Add("r2", ((int)gameObject.GetComponent<UnmannedAerialVehicleManage>().wrjModel).ToString());
|
replaceInfoDic.Add("r2", ((int)gameObject.GetComponent<UnmannedAerialVehicleManage>().wrjModel).ToString());
|
||||||
StartCoroutine(AsyncWebReq.PostData2(Url_AddDeviceAndGetDeviceId, replaceInfoDic, ResultsInfo =>
|
StartCoroutine(AsyncWebReq.PostData2(Url_AddDeviceAndGetDeviceId, replaceInfoDic, ResultsInfo =>
|
||||||
{
|
{
|
||||||
|
|
|
@ -120,7 +120,7 @@ public class LaserFireControlPlatformManger : MonoBehaviour
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 十字准星架视角
|
/// 十字准星架视角
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Camera Camera;
|
public Camera camera;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 十字准星架视角UI显示
|
/// 十字准星架视角UI显示
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -137,12 +137,24 @@ public class LaserFireControlPlatformManger : MonoBehaviour
|
||||||
/// 点击空白处碰撞器
|
/// 点击空白处碰撞器
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public GameObject Detection;
|
public GameObject Detection;
|
||||||
|
/// <summary>
|
||||||
|
/// 摄像机视角开关
|
||||||
|
/// </summary>
|
||||||
|
public bool isplaser = true;
|
||||||
|
/// <summary>
|
||||||
|
/// 激光火炮打击时间
|
||||||
|
/// </summary>
|
||||||
|
public static float lasertime;
|
||||||
|
public float lasertimes;
|
||||||
|
/// <summary>
|
||||||
|
/// 判断物体是否在相机里面
|
||||||
|
/// </summary>
|
||||||
|
public bool ispcamera;
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
equipmentCommon = GetComponent<EquipmentCommon>();
|
equipmentCommon = GetComponent<EquipmentCommon>();
|
||||||
laserFireControlPlatformMangers.Add(this);
|
laserFireControlPlatformMangers.Add(this);
|
||||||
Camera = transform.GetChild(1).GetComponent<Camera>();
|
camera = transform.GetChild(1).GetComponent<Camera>();
|
||||||
//weaponitemones = Newtonsoft.Json.JsonConvert.DeserializeObject<Weaponitemone>(msg);
|
//weaponitemones = Newtonsoft.Json.JsonConvert.DeserializeObject<Weaponitemone>(msg);
|
||||||
//FillInTheData(weaponitemones);//测试写入
|
//FillInTheData(weaponitemones);//测试写入
|
||||||
// 订阅布尔值变化事件
|
// 订阅布尔值变化事件
|
||||||
|
@ -176,6 +188,10 @@ public class LaserFireControlPlatformManger : MonoBehaviour
|
||||||
|
|
||||||
void Update()
|
void Update()
|
||||||
{
|
{
|
||||||
|
if (lasertime>0)
|
||||||
|
{
|
||||||
|
lasertime -= Time.deltaTime;
|
||||||
|
}
|
||||||
//if (UIBootstrap.Instance.GetRoleByIDPracticeId(GlobalFlag.practiceSeatId) != "0"&&Input.GetMouseButtonDown(0))
|
//if (UIBootstrap.Instance.GetRoleByIDPracticeId(GlobalFlag.practiceSeatId) != "0"&&Input.GetMouseButtonDown(0))
|
||||||
//{
|
//{
|
||||||
// if (!EventSystem.current.IsPointerOverGameObject())
|
// if (!EventSystem.current.IsPointerOverGameObject())
|
||||||
|
@ -184,6 +200,7 @@ public class LaserFireControlPlatformManger : MonoBehaviour
|
||||||
// Front = true;
|
// Front = true;
|
||||||
// }
|
// }
|
||||||
//}
|
//}
|
||||||
|
|
||||||
if (UIBootstrap.Instance.GetRoleByIDPracticeId(GlobalFlag.practiceSeatId) != "0" && Input.GetMouseButtonDown(0))
|
if (UIBootstrap.Instance.GetRoleByIDPracticeId(GlobalFlag.practiceSeatId) != "0" && Input.GetMouseButtonDown(0))
|
||||||
{
|
{
|
||||||
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
|
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
|
||||||
|
@ -254,16 +271,20 @@ public class LaserFireControlPlatformManger : MonoBehaviour
|
||||||
{
|
{
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
yield return new WaitForSeconds(timepiece);
|
yield return new WaitForSeconds(lasertime);
|
||||||
if (timepiece!=0)
|
if (lasertime != 0)
|
||||||
{
|
{
|
||||||
Laserattack();
|
//Laserattack();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void LateUpdate()
|
void LateUpdate()
|
||||||
{
|
{
|
||||||
|
if (Receivingdistance > 0 && isplaser == true)
|
||||||
|
{
|
||||||
|
camera.farClipPlane = Receivingdistance;
|
||||||
|
isplaser = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -282,7 +303,8 @@ public class LaserFireControlPlatformManger : MonoBehaviour
|
||||||
{
|
{
|
||||||
case "储能间隔时间:":
|
case "储能间隔时间:":
|
||||||
StorageIntervalTime = weaponitemone[i].para_value;
|
StorageIntervalTime = weaponitemone[i].para_value;
|
||||||
timepiece = float.Parse(StorageIntervalTime);
|
lasertime = float.Parse(StorageIntervalTime);
|
||||||
|
lasertimes = float.Parse(StorageIntervalTime);
|
||||||
break;
|
break;
|
||||||
case "毁伤目标累积作用时间:":
|
case "毁伤目标累积作用时间:":
|
||||||
CumulativeActionTimeOfDamageTarget = weaponitemone[i].para_value;
|
CumulativeActionTimeOfDamageTarget = weaponitemone[i].para_value;
|
||||||
|
@ -309,7 +331,6 @@ public class LaserFireControlPlatformManger : MonoBehaviour
|
||||||
if (Receivingdistance > 0 && targetPoint != null)
|
if (Receivingdistance > 0 && targetPoint != null)
|
||||||
{
|
{
|
||||||
Collider[] colliders = Physics.OverlapSphere(transform.position, Receivingdistance);//检查是否在打击的范围内
|
Collider[] colliders = Physics.OverlapSphere(transform.position, Receivingdistance);//检查是否在打击的范围内
|
||||||
Debug.LogError("范围打击距离:" + Receivingdistance);
|
|
||||||
for (int i = 0; i < colliders.Length; i++)
|
for (int i = 0; i < colliders.Length; i++)
|
||||||
{
|
{
|
||||||
if (colliders[i].gameObject.tag == "WRJ")
|
if (colliders[i].gameObject.tag == "WRJ")
|
||||||
|
@ -371,11 +392,10 @@ public class LaserFireControlPlatformManger : MonoBehaviour
|
||||||
{
|
{
|
||||||
if (targetPoint != null)
|
if (targetPoint != null)
|
||||||
{
|
{
|
||||||
LaserModer.transform.DOLookAt(targetPoint.position, 1.5f).OnComplete(() =>
|
LaserModer.transform.DOLookAt(targetPoint.position,0.5f).OnComplete(() =>
|
||||||
{
|
{
|
||||||
|
|
||||||
isLasing = false;
|
|
||||||
//CastRayAndRender();
|
|
||||||
});
|
});
|
||||||
//var nowData = GetSyncData();
|
//var nowData = GetSyncData();
|
||||||
//_ = SyncCreateRoom.SendMessageAsync(string.Format("send2room {0}", nowData));
|
//_ = SyncCreateRoom.SendMessageAsync(string.Format("send2room {0}", nowData));
|
||||||
|
@ -392,8 +412,44 @@ public class LaserFireControlPlatformManger : MonoBehaviour
|
||||||
{
|
{
|
||||||
if (targetPoint != null)
|
if (targetPoint != null)
|
||||||
{
|
{
|
||||||
Camera.transform.DOLookAt(targetPoint.position, 1.5f).SetEase(Ease.Linear);
|
camera.transform.DOLookAt(targetPoint.position,0.5f).SetEase(Ease.Linear).OnComplete(() =>
|
||||||
//isLasing = false;
|
{
|
||||||
|
Debug.LogError("看向进来了");
|
||||||
|
Launchanattack();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 激光显示
|
||||||
|
/// </summary>
|
||||||
|
public void Launchanattack()
|
||||||
|
{
|
||||||
|
if (targetPoint != null)
|
||||||
|
{
|
||||||
|
Vector3 pos = camera.WorldToViewportPoint(targetPoint.position);
|
||||||
|
ispcamera = (pos.x > 0 && pos.x < 1 && pos.y > 0 && pos.y < 1 && pos.z > 0);
|
||||||
|
if (ispcamera)
|
||||||
|
{
|
||||||
|
Debug.LogError("出现在摄像机视角里面了");
|
||||||
|
Vector3 cector = targetPoint.position - transform.position;
|
||||||
|
float angle = Vector3.Angle(cector, transform.forward);
|
||||||
|
if (float.Parse(InterferenceAngle) > angle)
|
||||||
|
{
|
||||||
|
Debug.Log("角度合适进行打击");
|
||||||
|
var nowData = GetSyncData();
|
||||||
|
_ = SyncCreateRoom.SendMessageAsync(string.Format("send2room {0}", nowData));
|
||||||
|
CastRayAndRender();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.LogError("超出了角度不进行攻击");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.LogError("飞机不在摄像机范围内");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -406,14 +462,14 @@ public class LaserFireControlPlatformManger : MonoBehaviour
|
||||||
if (InnerLaserlineRenderer)
|
if (InnerLaserlineRenderer)
|
||||||
{
|
{
|
||||||
InnerLaserlineRenderer.SetPosition(0, LaserPoint.transform.position); // 设置线段起点为物体位置
|
InnerLaserlineRenderer.SetPosition(0, LaserPoint.transform.position); // 设置线段起点为物体位置
|
||||||
InnerLaserlineRenderer.SetPosition(1, Receivingposin.position); // 设置线段终点为目标点
|
InnerLaserlineRenderer.SetPosition(1, targetPoint.position); // 设置线段终点为目标点
|
||||||
}
|
}
|
||||||
if (OuterLaserlineRenderer)
|
if (OuterLaserlineRenderer)
|
||||||
{
|
{
|
||||||
OuterLaserlineRenderer.SetPosition(0, LaserPoint.transform.position); // 设置线段起点为物体位置
|
OuterLaserlineRenderer.SetPosition(0, LaserPoint.transform.position); // 设置线段起点为物体位置
|
||||||
OuterLaserlineRenderer.SetPosition(1, Receivingposin.position); // 设置线段终点为目标点
|
OuterLaserlineRenderer.SetPosition(1, targetPoint.position); // 设置线段终点为目标点
|
||||||
}
|
}
|
||||||
StrikeDrone(Receivingposin);
|
StrikeDrone(targetPoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -429,46 +485,7 @@ public class LaserFireControlPlatformManger : MonoBehaviour
|
||||||
StartCoroutine(LaserExtinction());
|
StartCoroutine(LaserExtinction());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/// <summary>
|
|
||||||
/// 激光打击位置未打中
|
|
||||||
/// </summary>
|
|
||||||
public void Lasering()
|
|
||||||
{
|
|
||||||
if (targetPoint != null)
|
|
||||||
{
|
|
||||||
targetPoint.position = new Vector3(targetPoint.position.x + 5, targetPoint.position.y, transform.position.z);
|
|
||||||
LaserModer.transform.DOLookAt(targetPoint.position, 0.5f);
|
|
||||||
//CastRayAndRender1();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// 十字准星架为打中视角
|
|
||||||
/// </summary>
|
|
||||||
public void Crosshair1()
|
|
||||||
{
|
|
||||||
if (targetPoint != null)
|
|
||||||
{
|
|
||||||
targetPoint.position = new Vector3(targetPoint.position.x + 5, targetPoint.position.y, transform.position.z);
|
|
||||||
Camera.transform.DOLookAt(targetPoint.position, 0.1f).SetEase(Ease.Linear);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// 激光显示为打中
|
|
||||||
/// </summary>
|
|
||||||
public void CastRayAndRender1()
|
|
||||||
{
|
|
||||||
if (InnerLaserlineRenderer)
|
|
||||||
{
|
|
||||||
InnerLaserlineRenderer.SetPosition(0, LaserPoint.transform.position); // 设置线段起点为物体位置
|
|
||||||
InnerLaserlineRenderer.SetPosition(1, Receivingposin.position); // 设置线段终点为目标点
|
|
||||||
}
|
|
||||||
if (OuterLaserlineRenderer)
|
|
||||||
{
|
|
||||||
InnerLaserlineRenderer.SetPosition(0, LaserPoint.transform.position); // 设置线段起点为物体位置
|
|
||||||
InnerLaserlineRenderer.SetPosition(1, Receivingposin.position); // 设置线段终点为目标点
|
|
||||||
}
|
|
||||||
StartCoroutine(LaserExtinction());
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 销毁单体无人机
|
/// 销毁单体无人机
|
||||||
|
@ -539,7 +556,11 @@ 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); // 设置线段终点为目标点
|
||||||
}
|
}
|
||||||
isLasings = false;
|
if (lasertimes!=0)
|
||||||
|
{
|
||||||
|
lasertime = lasertimes;
|
||||||
|
}
|
||||||
|
isLasing = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -552,8 +573,8 @@ public class LaserFireControlPlatformManger : MonoBehaviour
|
||||||
protected string GetSyncData()
|
protected string GetSyncData()
|
||||||
{
|
{
|
||||||
|
|
||||||
Debug.Log("目标点位..:" + Receivingposin.position);
|
Debug.Log("目标点位..:" + targetPoint.position);
|
||||||
return string.Format("{0},{1},{2},{3},{4}", "Lasing", equipmentCommon.deviceID, Receivingposin.position.x, Receivingposin.position.y, Receivingposin.position.z);
|
return string.Format("{0},{1},{2},{3},{4}", "Lasing", equipmentCommon.deviceID, targetPoint.position.x, targetPoint.position.y, targetPoint.position.z);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -118,6 +118,10 @@ public class RadarManger : MonoBehaviour
|
||||||
/// 渲染小地图摄像机
|
/// 渲染小地图摄像机
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Camera Mincamera;
|
public Camera Mincamera;
|
||||||
|
/// <summary>
|
||||||
|
/// 计时火炮蓄能时间
|
||||||
|
/// </summary>
|
||||||
|
public float radartime=0;
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
Mincamera = GameObject.Find("Minimap Camera").GetComponent<Camera>();
|
Mincamera = GameObject.Find("Minimap Camera").GetComponent<Camera>();
|
||||||
|
@ -163,7 +167,7 @@ public class RadarManger : MonoBehaviour
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
//Debug.Log("Timer fired at: " + Time.time);
|
//Debug.Log("Timer fired at: " + Time.time);
|
||||||
yield return new WaitForSeconds(interval); // 等待一段时间后继续执行
|
yield return new WaitForSeconds(5); // 等待一段时间后继续执行
|
||||||
//RetrievalUAV();
|
//RetrievalUAV();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -186,9 +190,11 @@ public class RadarManger : MonoBehaviour
|
||||||
{
|
{
|
||||||
if (equipmentCommon.isPlayer && timerCoroutine != null)
|
if (equipmentCommon.isPlayer && timerCoroutine != null)
|
||||||
{
|
{
|
||||||
|
|
||||||
StopCoroutine(timerCoroutine);
|
StopCoroutine(timerCoroutine);
|
||||||
timerCoroutine = null;
|
timerCoroutine = null;
|
||||||
isTimerRunning = false;
|
isTimerRunning = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -299,6 +305,9 @@ public class RadarManger : MonoBehaviour
|
||||||
UnmannedAerialVehicle unmannedAerialVehicle = colliders2[i].GetComponent<UnmannedAerialVehicle>();
|
UnmannedAerialVehicle unmannedAerialVehicle = colliders2[i].GetComponent<UnmannedAerialVehicle>();
|
||||||
if (unmannedAerialVehicle)
|
if (unmannedAerialVehicle)
|
||||||
{
|
{
|
||||||
|
if (radartime == LaserFireControlPlatformManger.lasertime)
|
||||||
|
{
|
||||||
|
Debug.Log("今来了");
|
||||||
LaserFireControlPlatformManger laserFireControlPlatformManger = LaserFireControlPlatformManger.laserFireControlPlatformMangers.Find(x => (x != null && x.isLasing == false));
|
LaserFireControlPlatformManger laserFireControlPlatformManger = LaserFireControlPlatformManger.laserFireControlPlatformMangers.Find(x => (x != null && x.isLasing == false));
|
||||||
if (laserFireControlPlatformManger)
|
if (laserFireControlPlatformManger)
|
||||||
{
|
{
|
||||||
|
@ -307,6 +316,8 @@ public class RadarManger : MonoBehaviour
|
||||||
laserFireControlPlatformManger.targetPoint = unmannedAerialVehicle.transform;
|
laserFireControlPlatformManger.targetPoint = unmannedAerialVehicle.transform;
|
||||||
laserFireControlPlatformManger.Crosshair();
|
laserFireControlPlatformManger.Crosshair();
|
||||||
laserFireControlPlatformManger.Lasing();
|
laserFireControlPlatformManger.Lasing();
|
||||||
|
radartime = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
number++;
|
number++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue