diff --git a/Assets/Scripts/ANet/1050.prefab b/Assets/Scripts/ANet/1050.prefab new file mode 100644 index 0000000..fed2dca --- /dev/null +++ b/Assets/Scripts/ANet/1050.prefab @@ -0,0 +1,95 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &828837962821698955 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2766332253738962693} + - component: {fileID: 4441406424967128446} + - component: {fileID: 2194364438564339512} + - component: {fileID: 124552416461216991} + m_Layer: 0 + m_Name: 1050 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2766332253738962693 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 828837962821698955} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -12.29, y: -17.561468, z: 44.57} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &4441406424967128446 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 828837962821698955} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &2194364438564339512 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 828837962821698955} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!65 &124552416461216991 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 828837962821698955} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} diff --git a/Assets/Scripts/ANet/1050.prefab.meta b/Assets/Scripts/ANet/1050.prefab.meta new file mode 100644 index 0000000..590d65a --- /dev/null +++ b/Assets/Scripts/ANet/1050.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 1d7e2089fedd15042abdf9c3d51f9f45 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/ANet/1070.prefab b/Assets/Scripts/ANet/1070.prefab new file mode 100644 index 0000000..5e921af --- /dev/null +++ b/Assets/Scripts/ANet/1070.prefab @@ -0,0 +1,95 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &2167326369605691856 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2126840323371821178} + - component: {fileID: 8179030164542162640} + - component: {fileID: 1293765920705320252} + - component: {fileID: 8205304985678027396} + m_Layer: 0 + m_Name: 1070 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2126840323371821178 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2167326369605691856} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -17.22, y: -17.561468, z: 44.57} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &8179030164542162640 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2167326369605691856} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &1293765920705320252 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2167326369605691856} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!65 &8205304985678027396 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2167326369605691856} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} diff --git a/Assets/Scripts/ANet/1070.prefab.meta b/Assets/Scripts/ANet/1070.prefab.meta new file mode 100644 index 0000000..a9cc643 --- /dev/null +++ b/Assets/Scripts/ANet/1070.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 4f1c609155d280f428054b156f3d6329 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/ANet/1090.prefab b/Assets/Scripts/ANet/1090.prefab new file mode 100644 index 0000000..2825a97 --- /dev/null +++ b/Assets/Scripts/ANet/1090.prefab @@ -0,0 +1,95 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &3613886137469071075 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6356296298930090679} + - component: {fileID: 190299783482546276} + - component: {fileID: 8925865812028571756} + - component: {fileID: 929843984405384557} + m_Layer: 0 + m_Name: 1090 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6356296298930090679 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3613886137469071075} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -12.29, y: -17.561468, z: 42.07} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &190299783482546276 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3613886137469071075} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &8925865812028571756 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3613886137469071075} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!65 &929843984405384557 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3613886137469071075} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} diff --git a/Assets/Scripts/ANet/1090.prefab.meta b/Assets/Scripts/ANet/1090.prefab.meta new file mode 100644 index 0000000..c738e79 --- /dev/null +++ b/Assets/Scripts/ANet/1090.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 935df60b1b4260d4eadaf4734a4e4c1d +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Main/Core/PersonnelLocation/LocationSimulator.cs b/Assets/Scripts/Main/Core/PersonnelLocation/LocationSimulator.cs index 2b4e429..6478d0a 100644 --- a/Assets/Scripts/Main/Core/PersonnelLocation/LocationSimulator.cs +++ b/Assets/Scripts/Main/Core/PersonnelLocation/LocationSimulator.cs @@ -3,6 +3,7 @@ using System; using System.Collections; using System.Collections.Generic; using UnityEngine; +using UnityEngine.AI; public class LTData { @@ -238,11 +239,13 @@ public class LocationSimulator : MonoBehaviour if (agentControllers.ContainsKey(data.targetNo)) { agentControllers[data.targetNo].UpdatePosition(data); + //agentControllers[data.targetNo].enabled = false; agentControllers[data.targetNo].transform.position = Main.LocationSimulator.ConversionTransform(data); } else { var agent = CreateAgent(data); + agent.GetComponent().enabled = false; agentControllers.Add(data.targetNo, agent); } @@ -310,13 +313,15 @@ public class LocationSimulator : MonoBehaviour /// public Vector3 ConversionTransform(LocationData data) { + Debug.Log($"基站列表{data.stations}+位置信息:{data.xAxis + "," + data.yAxis}"); LTData ltData = Config.LTPostions[0]; if (ltData == null) return Vector3.zero; //取最高处作为pos.y方便向下打射线 float y = ltData.PTop.y > ltData.PBottom.y ? ltData.PTop.y : ltData.PBottom.y; + // float y = -17.5f; //对方传入转换后的数据 - var pos = new Vector3((float)data.xAxis, y, (float)data.zAxis); + var pos = new Vector3(-((float)data.xAxis - offsetX), y, -((float)data.yAxis - offsetZ)); if (data.stations.Contains(ltData.LTBottomCode) && !data.stations.Contains(ltData.LTMidCode)) { //下面地面 @@ -393,6 +398,40 @@ public class LocationSimulator : MonoBehaviour else pos.y = ltData.PBottom.y; } + + //纠偏1050-1070-10.4- -13.5 -12.27- -15.5 + if (data.stations.Contains("1050") && data.stations.Contains("1070")) + { + var str = $"1050-1070:换算前{pos.x}"; + pos.z = 44.57f; + + if (pos.x > -12.27f) + { + pos.x = -12.27f; + } + if (pos.x < -17.22f) + { + pos.x = -17.22f; + } + pos.x = pos.x - 2; + //Debug.Log(str + $"换算后:{ pos.x}"); + } + //纠偏1050-1090 + if (data.stations.Contains("1050") && data.stations.Contains("1090")) + { + var str = ($"1050-1090:换算前{pos.z}"); + pos.x = -12.29f; + if (pos.z > 44.57f) + { + pos.z = 44.57f; + } + if (pos.z < 42.07f) + { + pos.z = 42.07f; + } + //Debug.Log(str + $"换算后{ pos.z}"); + } + return pos; } /// diff --git a/Assets/StreamingAssets/Config.json b/Assets/StreamingAssets/Config.json index 1639867..13203f0 100644 --- a/Assets/StreamingAssets/Config.json +++ b/Assets/StreamingAssets/Config.json @@ -16,9 +16,9 @@ { "FloorId": 4, "LTName": "LT65", - "LTTopCode": "1", - "LTMidCode": "2", - "LTBottomCode": "3", + "LTTopCode": "106", + "LTMidCode": "108", + "LTBottomCode": "107", "PTop": { "x": -15.48, "y": -14.3, @@ -42,36 +42,5 @@ "PWidthRange": 0.8, "PHalfWidthRange": 0.4, "IsTop_Bottom": false - }, - { - "FloorId": 5, - "LTName": "LT79", - "LTTopCode": "1", - "LTMidCode": "2", - "LTBottomCode": "3", - "PTop": { - "x": -15.48, - "y": -17.5, - "z": 41.83 - }, - "PTop_Half": { - "x": -15.48, - "y": -19.3, - "z": 37.48 - }, - "PHalf_Bottom": { - "x": -17.47, - "y": -19.3, - "z": 37.48 - }, - "PBottom": { - "x": -17.47, - "y": -21.1, - "z": 41.83 - }, - "PWidthRange": 0.8, - "PHalfWidthRange": 0.4, - "IsTop_Bottom": true - } - ] + } ] } \ No newline at end of file