Merge branch 'master' of http://git.umayle.com:2023/yulong/NewN_UAVPlane
This commit is contained in:
commit
aaeffc4578
Binary file not shown.
|
@ -0,0 +1,97 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: d14c6397f108bf64b96946deb44c3369
|
||||||
|
ModelImporter:
|
||||||
|
serializedVersion: 19301
|
||||||
|
internalIDToNameTable: []
|
||||||
|
externalObjects: {}
|
||||||
|
materials:
|
||||||
|
materialImportMode: 1
|
||||||
|
materialName: 0
|
||||||
|
materialSearch: 1
|
||||||
|
materialLocation: 1
|
||||||
|
animations:
|
||||||
|
legacyGenerateAnimations: 4
|
||||||
|
bakeSimulation: 0
|
||||||
|
resampleCurves: 1
|
||||||
|
optimizeGameObjects: 0
|
||||||
|
motionNodeName:
|
||||||
|
rigImportErrors:
|
||||||
|
rigImportWarnings:
|
||||||
|
animationImportErrors:
|
||||||
|
animationImportWarnings:
|
||||||
|
animationRetargetingWarnings:
|
||||||
|
animationDoRetargetingWarnings: 0
|
||||||
|
importAnimatedCustomProperties: 0
|
||||||
|
importConstraints: 0
|
||||||
|
animationCompression: 1
|
||||||
|
animationRotationError: 0.5
|
||||||
|
animationPositionError: 0.5
|
||||||
|
animationScaleError: 0.5
|
||||||
|
animationWrapMode: 0
|
||||||
|
extraExposedTransformPaths: []
|
||||||
|
extraUserProperties: []
|
||||||
|
clipAnimations: []
|
||||||
|
isReadable: 0
|
||||||
|
meshes:
|
||||||
|
lODScreenPercentages: []
|
||||||
|
globalScale: 1
|
||||||
|
meshCompression: 0
|
||||||
|
addColliders: 0
|
||||||
|
useSRGBMaterialColor: 1
|
||||||
|
sortHierarchyByName: 1
|
||||||
|
importVisibility: 1
|
||||||
|
importBlendShapes: 1
|
||||||
|
importCameras: 1
|
||||||
|
importLights: 1
|
||||||
|
fileIdsGeneration: 2
|
||||||
|
swapUVChannels: 0
|
||||||
|
generateSecondaryUV: 0
|
||||||
|
useFileUnits: 1
|
||||||
|
keepQuads: 0
|
||||||
|
weldVertices: 1
|
||||||
|
preserveHierarchy: 0
|
||||||
|
skinWeightsMode: 0
|
||||||
|
maxBonesPerVertex: 4
|
||||||
|
minBoneWeight: 0.001
|
||||||
|
meshOptimizationFlags: -1
|
||||||
|
indexFormat: 0
|
||||||
|
secondaryUVAngleDistortion: 8
|
||||||
|
secondaryUVAreaDistortion: 15.000001
|
||||||
|
secondaryUVHardAngle: 88
|
||||||
|
secondaryUVPackMargin: 4
|
||||||
|
useFileScale: 1
|
||||||
|
tangentSpace:
|
||||||
|
normalSmoothAngle: 60
|
||||||
|
normalImportMode: 0
|
||||||
|
tangentImportMode: 3
|
||||||
|
normalCalculationMode: 4
|
||||||
|
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
|
||||||
|
blendShapeNormalImportMode: 1
|
||||||
|
normalSmoothingSource: 0
|
||||||
|
referencedClips: []
|
||||||
|
importAnimation: 1
|
||||||
|
humanDescription:
|
||||||
|
serializedVersion: 3
|
||||||
|
human: []
|
||||||
|
skeleton: []
|
||||||
|
armTwist: 0.5
|
||||||
|
foreArmTwist: 0.5
|
||||||
|
upperLegTwist: 0.5
|
||||||
|
legTwist: 0.5
|
||||||
|
armStretch: 0.05
|
||||||
|
legStretch: 0.05
|
||||||
|
feetSpacing: 0
|
||||||
|
globalScale: 1
|
||||||
|
rootMotionBoneName:
|
||||||
|
hasTranslationDoF: 0
|
||||||
|
hasExtraRoot: 0
|
||||||
|
skeletonHasParents: 1
|
||||||
|
lastHumanDescriptionAvatarSource: {instanceID: 0}
|
||||||
|
autoGenerateAvatarMappingIfUnspecified: 1
|
||||||
|
animationType: 2
|
||||||
|
humanoidOversampling: 1
|
||||||
|
avatarSetup: 0
|
||||||
|
additionalBone: 0
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -0,0 +1,11 @@
|
||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!319 &31900000
|
||||||
|
AvatarMask:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_Name: New Avatar Mask
|
||||||
|
m_Mask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000
|
||||||
|
m_Elements: []
|
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 8a4a2cf9205624540a9c7617335bf152
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 0
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
Binary file not shown.
|
@ -0,0 +1,97 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: dd536922f5b25504f9b0678c144c77fe
|
||||||
|
ModelImporter:
|
||||||
|
serializedVersion: 19301
|
||||||
|
internalIDToNameTable: []
|
||||||
|
externalObjects: {}
|
||||||
|
materials:
|
||||||
|
materialImportMode: 1
|
||||||
|
materialName: 0
|
||||||
|
materialSearch: 1
|
||||||
|
materialLocation: 1
|
||||||
|
animations:
|
||||||
|
legacyGenerateAnimations: 4
|
||||||
|
bakeSimulation: 0
|
||||||
|
resampleCurves: 1
|
||||||
|
optimizeGameObjects: 0
|
||||||
|
motionNodeName:
|
||||||
|
rigImportErrors:
|
||||||
|
rigImportWarnings:
|
||||||
|
animationImportErrors:
|
||||||
|
animationImportWarnings:
|
||||||
|
animationRetargetingWarnings:
|
||||||
|
animationDoRetargetingWarnings: 0
|
||||||
|
importAnimatedCustomProperties: 0
|
||||||
|
importConstraints: 0
|
||||||
|
animationCompression: 1
|
||||||
|
animationRotationError: 0.5
|
||||||
|
animationPositionError: 0.5
|
||||||
|
animationScaleError: 0.5
|
||||||
|
animationWrapMode: 0
|
||||||
|
extraExposedTransformPaths: []
|
||||||
|
extraUserProperties: []
|
||||||
|
clipAnimations: []
|
||||||
|
isReadable: 0
|
||||||
|
meshes:
|
||||||
|
lODScreenPercentages: []
|
||||||
|
globalScale: 1
|
||||||
|
meshCompression: 0
|
||||||
|
addColliders: 0
|
||||||
|
useSRGBMaterialColor: 1
|
||||||
|
sortHierarchyByName: 1
|
||||||
|
importVisibility: 1
|
||||||
|
importBlendShapes: 1
|
||||||
|
importCameras: 1
|
||||||
|
importLights: 1
|
||||||
|
fileIdsGeneration: 2
|
||||||
|
swapUVChannels: 0
|
||||||
|
generateSecondaryUV: 0
|
||||||
|
useFileUnits: 1
|
||||||
|
keepQuads: 0
|
||||||
|
weldVertices: 1
|
||||||
|
preserveHierarchy: 0
|
||||||
|
skinWeightsMode: 0
|
||||||
|
maxBonesPerVertex: 4
|
||||||
|
minBoneWeight: 0.001
|
||||||
|
meshOptimizationFlags: -1
|
||||||
|
indexFormat: 0
|
||||||
|
secondaryUVAngleDistortion: 8
|
||||||
|
secondaryUVAreaDistortion: 15.000001
|
||||||
|
secondaryUVHardAngle: 88
|
||||||
|
secondaryUVPackMargin: 4
|
||||||
|
useFileScale: 1
|
||||||
|
tangentSpace:
|
||||||
|
normalSmoothAngle: 60
|
||||||
|
normalImportMode: 0
|
||||||
|
tangentImportMode: 3
|
||||||
|
normalCalculationMode: 4
|
||||||
|
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
|
||||||
|
blendShapeNormalImportMode: 1
|
||||||
|
normalSmoothingSource: 0
|
||||||
|
referencedClips: []
|
||||||
|
importAnimation: 1
|
||||||
|
humanDescription:
|
||||||
|
serializedVersion: 3
|
||||||
|
human: []
|
||||||
|
skeleton: []
|
||||||
|
armTwist: 0.5
|
||||||
|
foreArmTwist: 0.5
|
||||||
|
upperLegTwist: 0.5
|
||||||
|
legTwist: 0.5
|
||||||
|
armStretch: 0.05
|
||||||
|
legStretch: 0.05
|
||||||
|
feetSpacing: 0
|
||||||
|
globalScale: 1
|
||||||
|
rootMotionBoneName:
|
||||||
|
hasTranslationDoF: 0
|
||||||
|
hasExtraRoot: 0
|
||||||
|
skeletonHasParents: 1
|
||||||
|
lastHumanDescriptionAvatarSource: {instanceID: 0}
|
||||||
|
autoGenerateAvatarMappingIfUnspecified: 1
|
||||||
|
animationType: 2
|
||||||
|
humanoidOversampling: 1
|
||||||
|
avatarSetup: 0
|
||||||
|
additionalBone: 0
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -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:
|
|
@ -51,13 +51,12 @@ public class DragController : MonoBehaviour, IBeginDragHandler, IEndDragHandler,
|
||||||
{
|
{
|
||||||
if (!isThinck)
|
if (!isThinck)
|
||||||
{
|
{
|
||||||
|
|
||||||
model.GetComponent<EquipmentCommon>().isPlayer = true;
|
model.GetComponent<EquipmentCommon>().isPlayer = true;
|
||||||
model.GetComponent<EquipmentCommon>().isStartRehearsing = GlobalFlag.isStartRehearsing;
|
model.GetComponent<EquipmentCommon>().isStartRehearsing = GlobalFlag.isStartRehearsing;
|
||||||
List<List_paraItem> temp = UIBootstrap.Instance.GetListParaItemById(deviceID);
|
|
||||||
model.GetComponent<EquipmentCommon>().FillInTheData(temp);
|
|
||||||
if (model.GetComponent<UnmannedAerialVehicleManage>())
|
if (model.GetComponent<UnmannedAerialVehicleManage>())
|
||||||
model.GetComponent<UnmannedAerialVehicleManage>().wrjModel = wrjModel;
|
model.GetComponent<UnmannedAerialVehicleManage>().wrjModel = wrjModel;
|
||||||
|
List<List_paraItem> temp = UIBootstrap.Instance.GetListParaItemById(deviceID);
|
||||||
|
model.GetComponent<EquipmentCommon>().FillInTheData(temp);
|
||||||
if (!isDragWRJ)
|
if (!isDragWRJ)
|
||||||
{
|
{
|
||||||
transform.SetAsLastSibling();
|
transform.SetAsLastSibling();
|
||||||
|
|
|
@ -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;
|
||||||
|
@ -372,6 +373,9 @@ public class GameManager : MonoSingleton<GameManager>
|
||||||
|
|
||||||
device.transform.position = new Vector3(float.Parse(deviceTran[0]), float.Parse(deviceTran[1]), float.Parse(deviceTran[2]));
|
device.transform.position = new Vector3(float.Parse(deviceTran[0]), float.Parse(deviceTran[1]), float.Parse(deviceTran[2]));
|
||||||
device.transform.eulerAngles = new Vector3(float.Parse(deviceTran[3]), float.Parse(deviceTran[4]), float.Parse(deviceTran[5]));
|
device.transform.eulerAngles = new Vector3(float.Parse(deviceTran[3]), float.Parse(deviceTran[4]), float.Parse(deviceTran[5]));
|
||||||
|
int wrjModelCount = int.Parse(data.r2);
|
||||||
|
if (device.GetComponent<UnmannedAerialVehicleManage>())
|
||||||
|
device.GetComponent<UnmannedAerialVehicleManage>().wrjModel = (WRJModel)wrjModelCount;
|
||||||
device.GetComponent<EquipmentCommon>().deviceID = data.id;
|
device.GetComponent<EquipmentCommon>().deviceID = data.id;
|
||||||
device.GetComponent<EquipmentCommon>().FillInTheData(data.list_para);
|
device.GetComponent<EquipmentCommon>().FillInTheData(data.list_para);
|
||||||
}
|
}
|
||||||
|
@ -416,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));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -109,7 +109,7 @@ public class EquipmentCommon : MonoBehaviour
|
||||||
spectrumdetection.isStartRehearsing = isStartRehearsing;
|
spectrumdetection.isStartRehearsing = isStartRehearsing;
|
||||||
break;
|
break;
|
||||||
case "微波武器":
|
case "微波武器":
|
||||||
Microwaveweapon microwaveweapon= GetComponent<Microwaveweapon>();
|
Microwaveweapon microwaveweapon = GetComponent<Microwaveweapon>();
|
||||||
microwaveweapon.isStartRehearsing = isStartRehearsing;
|
microwaveweapon.isStartRehearsing = isStartRehearsing;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -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}");
|
||||||
|
replaceInfoDic.Add("r2", ((int)gameObject.GetComponent<UnmannedAerialVehicleManage>().wrjModel).ToString());
|
||||||
StartCoroutine(AsyncWebReq.PostData2(Url_AddDeviceAndGetDeviceId, replaceInfoDic, ResultsInfo =>
|
StartCoroutine(AsyncWebReq.PostData2(Url_AddDeviceAndGetDeviceId, replaceInfoDic, ResultsInfo =>
|
||||||
{
|
{
|
||||||
ReturnDeviceID returnID = JsonConvert.DeserializeObject<ReturnDeviceID>(ResultsInfo);
|
ReturnDeviceID returnID = JsonConvert.DeserializeObject<ReturnDeviceID>(ResultsInfo);
|
||||||
|
@ -189,14 +190,15 @@ public class EquipmentCommon : MonoBehaviour
|
||||||
UploadLogMain uploadLogMain = new UploadLogMain();
|
UploadLogMain uploadLogMain = new UploadLogMain();
|
||||||
uploadLogMain.PracticeId = GlobalFlag.practiceSubjectID;
|
uploadLogMain.PracticeId = GlobalFlag.practiceSubjectID;
|
||||||
uploadLogMain.ThinkId = GlobalFlag.currentThinkId;
|
uploadLogMain.ThinkId = GlobalFlag.currentThinkId;
|
||||||
string log = currentTime + " " + equipmentType + "(" + deviceID + ")"+"生成 ";
|
string log = currentTime + " " + equipmentType + "(" + deviceID + ")" + "生成 ";
|
||||||
uploadLogMain.log = log;
|
uploadLogMain.log = log;
|
||||||
uploadLogMains.Add(uploadLogMain);
|
uploadLogMains.Add(uploadLogMain);
|
||||||
string uploadLogMainJson = JsonConvert.SerializeObject(uploadLogMains);
|
string uploadLogMainJson = JsonConvert.SerializeObject(uploadLogMains);
|
||||||
WWWForm wWWForm = new WWWForm();
|
WWWForm wWWForm = new WWWForm();
|
||||||
wWWForm.AddField("data", uploadLogMainJson);
|
wWWForm.AddField("data", uploadLogMainJson);
|
||||||
Debug.Log(uploadLogMainJson);
|
Debug.Log(uploadLogMainJson);
|
||||||
StartCoroutine(PostString(Url_Addpracticelog, wWWForm, data => {
|
StartCoroutine(PostString(Url_Addpracticelog, wWWForm, data =>
|
||||||
|
{
|
||||||
Debug.Log(data);
|
Debug.Log(data);
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
@ -280,7 +282,7 @@ public class EquipmentCommon : MonoBehaviour
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "Planedata":
|
case "Planedata":
|
||||||
UnmannedAerialVehicleManage unmannedAerialVehicleManage1=GetComponent<UnmannedAerialVehicleManage>();
|
UnmannedAerialVehicleManage unmannedAerialVehicleManage1 = GetComponent<UnmannedAerialVehicleManage>();
|
||||||
if (unmannedAerialVehicleManage1)
|
if (unmannedAerialVehicleManage1)
|
||||||
{
|
{
|
||||||
UnmannedAerialVehicle unmannedAerialVehicle = unmannedAerialVehicleManage1.unmannedAerialVehicles.Find(x => x.serialNumber == data[2]);
|
UnmannedAerialVehicle unmannedAerialVehicle = unmannedAerialVehicleManage1.unmannedAerialVehicles.Find(x => x.serialNumber == data[2]);
|
||||||
|
|
|
@ -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,23 @@ public class LaserFireControlPlatformManger : MonoBehaviour
|
||||||
/// 点击空白处碰撞器
|
/// 点击空白处碰撞器
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public GameObject Detection;
|
public GameObject Detection;
|
||||||
|
/// <summary>
|
||||||
|
/// 摄像机视角开关
|
||||||
|
/// </summary>
|
||||||
|
public bool isplaser = true;
|
||||||
|
/// <summary>
|
||||||
|
/// 激光火炮打击时间
|
||||||
|
/// </summary>
|
||||||
|
public static float lasertime;
|
||||||
|
/// <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);//测试写入
|
||||||
// 订阅布尔值变化事件
|
// 订阅布尔值变化事件
|
||||||
|
@ -184,9 +195,9 @@ 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);
|
||||||
RaycastHit hit;
|
RaycastHit hit;
|
||||||
if (Physics.Raycast(ray, out hit))
|
if (Physics.Raycast(ray, out hit))
|
||||||
{
|
{
|
||||||
|
@ -194,7 +205,7 @@ public class LaserFireControlPlatformManger : MonoBehaviour
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (hit.transform.gameObject.tag == "AttackTarget"&&hit.transform.gameObject.name == "激光火控平台(Clone)")
|
if (hit.transform.gameObject.tag == "AttackTarget" && hit.transform.gameObject.name == "激光火控平台(Clone)")
|
||||||
{
|
{
|
||||||
Transform canvas = GameObject.Find("Canvas").transform;
|
Transform canvas = GameObject.Find("Canvas").transform;
|
||||||
if (canvas)
|
if (canvas)
|
||||||
|
@ -254,16 +265,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 +297,7 @@ public class LaserFireControlPlatformManger : MonoBehaviour
|
||||||
{
|
{
|
||||||
case "储能间隔时间:":
|
case "储能间隔时间:":
|
||||||
StorageIntervalTime = weaponitemone[i].para_value;
|
StorageIntervalTime = weaponitemone[i].para_value;
|
||||||
timepiece = float.Parse(StorageIntervalTime);
|
lasertime = float.Parse(StorageIntervalTime);
|
||||||
break;
|
break;
|
||||||
case "毁伤目标累积作用时间:":
|
case "毁伤目标累积作用时间:":
|
||||||
CumulativeActionTimeOfDamageTarget = weaponitemone[i].para_value;
|
CumulativeActionTimeOfDamageTarget = weaponitemone[i].para_value;
|
||||||
|
@ -306,10 +321,9 @@ public class LaserFireControlPlatformManger : MonoBehaviour
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void Laserattack()
|
public void Laserattack()
|
||||||
{
|
{
|
||||||
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")
|
||||||
|
@ -328,7 +342,7 @@ public class LaserFireControlPlatformManger : MonoBehaviour
|
||||||
{
|
{
|
||||||
Debug.LogError("角度没有问题进来了" + InterferenceAngle);
|
Debug.LogError("角度没有问题进来了" + InterferenceAngle);
|
||||||
|
|
||||||
if (Receivingposin==null)
|
if (Receivingposin == null)
|
||||||
{
|
{
|
||||||
//if (Random.value>0.5f)
|
//if (Random.value>0.5f)
|
||||||
//{
|
//{
|
||||||
|
@ -360,7 +374,7 @@ public class LaserFireControlPlatformManger : MonoBehaviour
|
||||||
|
|
||||||
private string GetSyncData1()
|
private string GetSyncData1()
|
||||||
{
|
{
|
||||||
return string.Format("{0},{1},{2},{3}" + equipmentCommon.deviceID, Receivingposin.position.x+3,Receivingposin.position.y+3,Receivingposin.position.z);
|
return string.Format("{0},{1},{2},{3}" + equipmentCommon.deviceID, Receivingposin.position.x + 3, Receivingposin.position.y + 3, Receivingposin.position.z);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -371,11 +385,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 +405,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 +455,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 +478,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 +549,7 @@ 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;
|
isLasing = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -552,8 +562,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;
|
||||||
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,15 +305,21 @@ public class RadarManger : MonoBehaviour
|
||||||
UnmannedAerialVehicle unmannedAerialVehicle = colliders2[i].GetComponent<UnmannedAerialVehicle>();
|
UnmannedAerialVehicle unmannedAerialVehicle = colliders2[i].GetComponent<UnmannedAerialVehicle>();
|
||||||
if (unmannedAerialVehicle)
|
if (unmannedAerialVehicle)
|
||||||
{
|
{
|
||||||
|
radartime += Time.deltaTime;
|
||||||
|
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));
|
||||||
|
radartime = 0;
|
||||||
if (laserFireControlPlatformManger)
|
if (laserFireControlPlatformManger)
|
||||||
{
|
{
|
||||||
laserFireControlPlatformManger.isLasing=true;
|
laserFireControlPlatformManger.isLasing = true;
|
||||||
//Debug.Log(laserFireControlPlatformManger.transform.name + "攻击无人机: " + unmannedAerialVehicle.transform.name);
|
//Debug.Log(laserFireControlPlatformManger.transform.name + "攻击无人机: " + unmannedAerialVehicle.transform.name);
|
||||||
laserFireControlPlatformManger.targetPoint = unmannedAerialVehicle.transform;
|
laserFireControlPlatformManger.targetPoint = unmannedAerialVehicle.transform;
|
||||||
laserFireControlPlatformManger.Crosshair();
|
laserFireControlPlatformManger.Crosshair();
|
||||||
laserFireControlPlatformManger.Lasing();
|
laserFireControlPlatformManger.Lasing();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
number++;
|
number++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -305,91 +305,13 @@ public class TerrestrialRadioInterferenceManger : MonoBehaviour
|
||||||
{
|
{
|
||||||
if (colliders[i].transform.tag == "WRJ")
|
if (colliders[i].transform.tag == "WRJ")
|
||||||
{
|
{
|
||||||
UnmannedAerialVehicle unmannedAerialVehicle = null;
|
|
||||||
if (colliders[i].GetComponent<UnmannedAerialVehicle>())
|
|
||||||
{
|
|
||||||
unmannedAerialVehicle = colliders[i].GetComponent<UnmannedAerialVehicle>();
|
|
||||||
}
|
|
||||||
UnmannedAerialVehicleManage unmannedAerialVehicleManage = null;
|
UnmannedAerialVehicleManage unmannedAerialVehicleManage = null;
|
||||||
if (colliders[i].GetComponent<UnmannedAerialVehicleManage>())
|
if (colliders[i].GetComponent<UnmannedAerialVehicleManage>())
|
||||||
{
|
{
|
||||||
unmannedAerialVehicleManage = colliders[i].GetComponent<UnmannedAerialVehicleManage>();
|
unmannedAerialVehicleManage = colliders[i].GetComponent<UnmannedAerialVehicleManage>();
|
||||||
}
|
}
|
||||||
if (TransmittedPower == "10~30W" || TransmittedPower == "30~50W" && unmannedAerialVehicleManage != null)
|
|
||||||
{
|
|
||||||
Debug.LogError("发射功率进来了1");
|
|
||||||
Debug.LogError(unmannedAerialVehicleManage.satellitePositioningFrequency);
|
|
||||||
Debug.LogError(InterferingFrequency);
|
|
||||||
if (unmannedAerialVehicleManage.satellitePositioningFrequency == InterferingFrequency && unmannedAerialVehicleManage != null)
|
|
||||||
{
|
|
||||||
Debug.LogError("相同频率进来了1");
|
|
||||||
Debug.LogError(InterferenceMode);
|
|
||||||
Debug.LogError(unmannedAerialVehicleManage != null);
|
|
||||||
|
|
||||||
if (InterferenceMode == "驱离" && unmannedAerialVehicleManage != null)
|
|
||||||
{
|
|
||||||
Debug.LogError("驱离");
|
|
||||||
|
|
||||||
unmannedAerialVehicleManage.transform.DOKill();
|
|
||||||
unmannedAerialVehicleManage.transform.LookAt(new Vector3(-500, 160, 1600));
|
|
||||||
unmannedAerialVehicleManage.transform.DOMove(new Vector3(-500, 160, 1600), 60);
|
|
||||||
|
|
||||||
}
|
|
||||||
else if (InterferenceMode == "迫降" && unmannedAerialVehicleManage != null)
|
|
||||||
{
|
|
||||||
Debug.LogError("迫降");
|
|
||||||
unmannedAerialVehicleManage.transform.DOKill();
|
|
||||||
//unmannedAerialVehicle.transform.DOKill();
|
|
||||||
//Debug.LogError(unmannedAerialVehicle.name);
|
|
||||||
RaycastHit hit;
|
|
||||||
if (Physics.Raycast(unmannedAerialVehicleManage.transform.position, Vector3.down, out hit, Mathf.Infinity, ground))
|
|
||||||
{
|
|
||||||
if (hit.distance > 1f)
|
|
||||||
{
|
|
||||||
Debug.LogError(hit.distance);
|
|
||||||
|
|
||||||
hit.point = new Vector3(hit.point.x, hit.point.y + 3, hit.point.z);
|
|
||||||
|
|
||||||
unmannedAerialVehicleManage.transform.DOMove(hit.point, 6);
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
speed = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (TransmittedPower == "50~100W" && unmannedAerialVehicleManage != null)
|
|
||||||
{
|
|
||||||
Debug.LogError("功率进来了2");
|
|
||||||
if (unmannedAerialVehicleManage.dataLinkCommunicationFrequency == InterferingFrequency && unmannedAerialVehicleManage != null)
|
|
||||||
{
|
|
||||||
Debug.LogError("频率进来了");
|
|
||||||
if (unmannedAerialVehicleManage != null)
|
if (unmannedAerialVehicleManage != null)
|
||||||
{
|
unmannedAerialVehicleManage.CheckSatellitePositioningFrequency(this.transform, InterferenceMode, TransmittedPower, InterferingFrequency, InterferenceAngle, ground);
|
||||||
Vector3 one = unmannedAerialVehicleManage.transform.position - transform.position;
|
|
||||||
float angue = Vector3.Angle(one, transform.forward);
|
|
||||||
if (float.Parse(InterferenceAngle) >= angue)
|
|
||||||
{
|
|
||||||
//unmannedAerialVehicleManage.transform.DOKill();
|
|
||||||
Debug.LogError("目标出现在范围内");
|
|
||||||
Debug.LogError(unmannedAerialVehicleManage.maximumFlyingSpeed);
|
|
||||||
unmannedAerialVehicleManage.maximumFlyingSpeed = (float.Parse(unmannedAerialVehicleManage.maximumFlyingSpeed) - 5).ToString();
|
|
||||||
Debug.LogError(unmannedAerialVehicleManage.maximumFlyingSpeed);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
|
|
||||||
Debug.LogError("目标没有出现在范围里面");
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -399,7 +321,7 @@ public class TerrestrialRadioInterferenceManger : MonoBehaviour
|
||||||
/// <exception cref="NotImplementedException"></exception>
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
private void Angularrange()
|
private void Angularrange()
|
||||||
{
|
{
|
||||||
Collider[] collider = Physics.OverlapSphere(transform.position,300);
|
Collider[] collider = Physics.OverlapSphere(transform.position, 300);
|
||||||
for (int i = 0; i < collider.Length; i++)
|
for (int i = 0; i < collider.Length; i++)
|
||||||
{
|
{
|
||||||
if (collider[i].transform.tag == "WRJ")
|
if (collider[i].transform.tag == "WRJ")
|
||||||
|
|
|
@ -8,6 +8,8 @@ using AdamSync;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using static InterfaceManager;
|
using static InterfaceManager;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using PData;
|
||||||
|
|
||||||
public enum WRJModel
|
public enum WRJModel
|
||||||
{
|
{
|
||||||
无人机,
|
无人机,
|
||||||
|
@ -98,6 +100,11 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool isEngagedTarget = false;
|
public bool isEngagedTarget = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 光学无人机
|
||||||
|
/// </summary>
|
||||||
|
public Camera gxWRJCamera;
|
||||||
|
|
||||||
#region 无人机数据
|
#region 无人机数据
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 续航时间
|
/// 续航时间
|
||||||
|
@ -246,6 +253,22 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void SwitchWRJModel()
|
||||||
|
{
|
||||||
|
gxWRJCamera.gameObject.SetActive(false);
|
||||||
|
switch (wrjModel)
|
||||||
|
{
|
||||||
|
case WRJModel.光学无人机:
|
||||||
|
gxWRJCamera.gameObject.SetActive(true);
|
||||||
|
break;
|
||||||
|
case WRJModel.电子侦察无人机:
|
||||||
|
break;
|
||||||
|
case WRJModel.自杀式无人机:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 攻击打击
|
/// 攻击打击
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -264,7 +287,7 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
||||||
isEngagedTarget = true;
|
isEngagedTarget = true;
|
||||||
colliders1.ForEach(x => Debug.Log(x.transform.name));
|
colliders1.ForEach(x => Debug.Log(x.transform.name));
|
||||||
int _number = UnityEngine.Random.Range(0, colliders1.Count - 1);
|
int _number = UnityEngine.Random.Range(0, colliders1.Count - 1);
|
||||||
List<UnmannedAerialVehicle> _unmannedAerialVehicles = unmannedAerialVehicles.FindAll(x => x != null&&x.gameObject.activeSelf);
|
List<UnmannedAerialVehicle> _unmannedAerialVehicles = unmannedAerialVehicles.FindAll(x => x != null && x.gameObject.activeSelf);
|
||||||
SendMsg(colliders1[_number].transform);
|
SendMsg(colliders1[_number].transform);
|
||||||
for (int i = 0; i < _unmannedAerialVehicles.Count; i++)
|
for (int i = 0; i < _unmannedAerialVehicles.Count; i++)
|
||||||
{
|
{
|
||||||
|
@ -325,6 +348,9 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
||||||
// Debug.Log(msg);
|
// Debug.Log(msg);
|
||||||
// _ = SyncCreateRoom.SendMessageAsync(msg);
|
// _ = SyncCreateRoom.SendMessageAsync(msg);
|
||||||
//}
|
//}
|
||||||
|
SenceInfo currentSceneInfo = new SenceInfo();
|
||||||
|
currentSceneInfo = UIBootstrap.Instance.currentSceneInfo.data;
|
||||||
|
//int windSpeed = Mathf.Lerp(0f, 1f, float.Parse(currentSceneInfo.EnvWindSpeed));
|
||||||
for (int i = 0; i < weaponitemone.Count; i++)
|
for (int i = 0; i < weaponitemone.Count; i++)
|
||||||
{
|
{
|
||||||
switch (weaponitemone[i].para_name)
|
switch (weaponitemone[i].para_name)
|
||||||
|
@ -337,7 +363,7 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
||||||
break;
|
break;
|
||||||
case "最大飞行速度:":
|
case "最大飞行速度:":
|
||||||
maximumFlyingSpeed = weaponitemone[i].para_value;
|
maximumFlyingSpeed = weaponitemone[i].para_value;
|
||||||
FireSpeed = float.Parse(maximumFlyingSpeed);
|
|
||||||
break;
|
break;
|
||||||
case "RCS:":
|
case "RCS:":
|
||||||
RCS = weaponitemone[i].para_value;
|
RCS = weaponitemone[i].para_value;
|
||||||
|
@ -422,12 +448,107 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///根据风得速度改变无人机得速度
|
||||||
|
FireSpeed = float.Parse(maximumFlyingSpeed) / int.Parse(currentSceneInfo.EnvWindSpeed);
|
||||||
|
///如果风速大于6级,无人机停止飞行
|
||||||
|
if (int.Parse(currentSceneInfo.EnvWindSpeed) > 6)
|
||||||
|
{
|
||||||
|
FireSpeed = 0;
|
||||||
|
}
|
||||||
|
CheckRSC();
|
||||||
if (i == (weaponitemone.Count - 1))
|
if (i == (weaponitemone.Count - 1))
|
||||||
{
|
{
|
||||||
StartCoroutine(WeaponitemoneDataAddition());
|
StartCoroutine(WeaponitemoneDataAddition());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 雷达检测无人机身上得RSC
|
||||||
|
/// </summary>
|
||||||
|
public void CheckRSC()
|
||||||
|
{
|
||||||
|
float rcs = float.Parse(RCS);
|
||||||
|
if (rcs <= 0.5 && rcs >= 0.1)
|
||||||
|
{
|
||||||
|
StartCoroutine(ShowRadarTips(0.8f, 2));
|
||||||
|
}
|
||||||
|
else if (rcs >= 0.5f && rcs <= 1)
|
||||||
|
{
|
||||||
|
StartCoroutine(ShowRadarTips(0.4f, 1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 多少时间在对方雷达界面上显示红色标记
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="minTime"></param>
|
||||||
|
/// <param name="maxTime"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
private IEnumerator ShowRadarTips(float minTime, float maxTime)
|
||||||
|
{
|
||||||
|
GameObject tips = transform.Find("Minimapwrj").gameObject;
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
tips.gameObject.SetActive(false);
|
||||||
|
float time = UnityEngine.Random.Range(minTime, maxTime);
|
||||||
|
yield return new WaitForSeconds(time);
|
||||||
|
tips.gameObject.SetActive(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 检测无线电频率
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="interferingFrequency">无线电数据</param>
|
||||||
|
/// <param name="interferenceMode">驱离或者迫降</param>
|
||||||
|
public void CheckSatellitePositioningFrequency(Transform target, string interferenceMode, string transmittedPower, string interferingFrequency, string interferenceAngle, LayerMask ground)
|
||||||
|
{
|
||||||
|
if (transmittedPower == "10~30W" || transmittedPower == "30~50W")
|
||||||
|
{
|
||||||
|
if (satellitePositioningFrequency == interferingFrequency)
|
||||||
|
{
|
||||||
|
if (interferenceMode == "驱离")
|
||||||
|
{
|
||||||
|
transform.DOKill();
|
||||||
|
transform.LookAt(new Vector3(-500, 160, 1600));
|
||||||
|
transform.DOMove(new Vector3(-500, 160, 1600), 60);
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (interferenceMode == "迫降")
|
||||||
|
{
|
||||||
|
transform.DOKill();
|
||||||
|
RaycastHit hit;
|
||||||
|
if (Physics.Raycast(transform.position, Vector3.down, out hit, Mathf.Infinity, ground))
|
||||||
|
{
|
||||||
|
if (hit.distance > 1f)
|
||||||
|
{
|
||||||
|
hit.point = new Vector3(hit.point.x, hit.point.y + 3, hit.point.z);
|
||||||
|
transform.DOMove(hit.point, 6);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (transmittedPower == "50~100W")
|
||||||
|
{
|
||||||
|
if (dataLinkCommunicationFrequency == interferingFrequency)
|
||||||
|
{
|
||||||
|
Vector3 one = transform.position - target.transform.position;
|
||||||
|
float angue = Vector3.Angle(one, target.transform.forward);
|
||||||
|
if (float.Parse(interferenceAngle) >= angue)
|
||||||
|
{
|
||||||
|
maximumFlyingSpeed = (float.Parse(maximumFlyingSpeed) - 5).ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 单个无人机数据写入
|
/// 单个无人机数据写入
|
||||||
|
@ -455,6 +576,9 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#region 阵型编队
|
#region 阵型编队
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 阵型选择
|
/// 阵型选择
|
||||||
|
@ -694,6 +818,7 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
||||||
}
|
}
|
||||||
private void OnDestroy()
|
private void OnDestroy()
|
||||||
{
|
{
|
||||||
|
StopAllCoroutines();
|
||||||
Destroy(airRoute.gameObject);
|
Destroy(airRoute.gameObject);
|
||||||
OnActivationChanged -= OnActivationChangedHandler;
|
OnActivationChanged -= OnActivationChangedHandler;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue