Merge branch 'master' of http://git.umayle.com:2023/yulong/NewN_UAVPlane
This commit is contained in:
commit
79b6304635
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:
|
|
@ -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);
|
||||||
|
@ -166,7 +167,7 @@ public class EquipmentCommon : MonoBehaviour
|
||||||
break;
|
break;
|
||||||
case "频谱探测":
|
case "频谱探测":
|
||||||
Spectrumdetection spectrumdetection = GetComponent<Spectrumdetection>();
|
Spectrumdetection spectrumdetection = GetComponent<Spectrumdetection>();
|
||||||
spectrumdetection.FillInTheData(weaponitemone);
|
spectrumdetection.FillInTheData(weaponitemone);
|
||||||
break;
|
break;
|
||||||
case "微波武器":
|
case "微波武器":
|
||||||
Microwaveweapon microwaveweapon = GetComponent<Microwaveweapon>();
|
Microwaveweapon microwaveweapon = GetComponent<Microwaveweapon>();
|
||||||
|
@ -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]);
|
||||||
|
@ -289,7 +291,7 @@ public class EquipmentCommon : MonoBehaviour
|
||||||
unmannedAerialVehicle.AddBao(false);
|
unmannedAerialVehicle.AddBao(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "SetToBeDestroyed"://设备被销毁
|
case "SetToBeDestroyed"://设备被销毁
|
||||||
GameObject Bao = Instantiate(explodePrefab, transform);
|
GameObject Bao = Instantiate(explodePrefab, transform);
|
||||||
Bao.transform.localPosition = Vector3.zero;
|
Bao.transform.localPosition = Vector3.zero;
|
||||||
|
|
|
@ -150,7 +150,7 @@ public class TerrestrialRadioInterferenceManger : MonoBehaviour
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#region 启动暂停
|
#region 启动暂停
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 导条变化调用
|
/// 导条变化调用
|
||||||
|
@ -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)
|
if (unmannedAerialVehicleManage != null)
|
||||||
{
|
unmannedAerialVehicleManage.CheckSatellitePositioningFrequency(this.transform, InterferenceMode, TransmittedPower, InterferingFrequency, InterferenceAngle, ground);
|
||||||
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)
|
|
||||||
{
|
|
||||||
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>
|
||||||
/// 续航时间
|
/// 续航时间
|
||||||
|
@ -178,7 +185,7 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var _unmannedAerialVehicle = unmannedAerialVehicles.FindAll(x => x != null && x.gameObject.activeSelf);
|
var _unmannedAerialVehicle = unmannedAerialVehicles.FindAll(x => x != null && x.gameObject.activeSelf);
|
||||||
|
@ -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