This commit is contained in:
yzx 2023-12-27 17:30:38 +08:00
parent 37d65b05f0
commit 0211fecd5f
6 changed files with 310 additions and 27 deletions

View File

@ -37564,7 +37564,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!4 &463649141
Transform:
m_ObjectHideFlags: 0
@ -38144,6 +38144,12 @@ Transform:
m_Father: {fileID: 917995222}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &469820069 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 1911478031, guid: 4292160a5e1fde347934ac660b2c5d30,
type: 3}
m_PrefabInstance: {fileID: 2037673174}
m_PrefabAsset: {fileID: 0}
--- !u!1 &473162663
GameObject:
m_ObjectHideFlags: 0
@ -60318,6 +60324,18 @@ MonoBehaviour:
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
- m_Target: {fileID: 1323185945}
m_TargetAssemblyTypeName: AccidentManager, Assembly-CSharp
m_MethodName: Close
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!114 &777589783
MonoBehaviour:
m_ObjectHideFlags: 0
@ -104861,7 +104879,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
uis: {fileID: 34988781}
baotai:
- {fileID: 2009850704}
- {fileID: 1337615172}
carGearControl: {fileID: 1276762320}
zuiwei: {fileID: 968945826}
diandongcheren: {fileID: 1384190233}
@ -105772,6 +105790,102 @@ MeshFilter:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1337131569}
m_Mesh: {fileID: -8214288195113887380, guid: 87a0133680c4d5f499f32d303d358b8e, type: 3}
--- !u!1 &1337615172
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1337615173}
- component: {fileID: 1337615176}
- component: {fileID: 1337615175}
- component: {fileID: 1337615174}
m_Layer: 0
m_Name: "\u7206\u80CE (2)"
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!4 &1337615173
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1337615172}
m_LocalRotation: {x: -0.26746163, y: -0.055704076, z: 0.043036826, w: 0.9609938}
m_LocalPosition: {x: 0.693, y: -0.033, z: -0.813}
m_LocalScale: {x: 0.4536, y: 0.072123155, z: 0.2131459}
m_Children: []
m_Father: {fileID: 2037673175}
m_RootOrder: 14
m_LocalEulerAnglesHint: {x: -30.615, y: -8.694, z: 7.512}
--- !u!65 &1337615174
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1337615172}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 0.63703644}
m_Center: {x: 7.7541107e-10, y: -0.000002294312, z: -0.18148151}
--- !u!23 &1337615175
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1337615172}
m_Enabled: 0
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
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
m_AdditionalVertexStreams: {fileID: 0}
--- !u!33 &1337615176
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1337615172}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1 &1338005075
GameObject:
m_ObjectHideFlags: 0
@ -130073,7 +130187,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!65 &1632119360
BoxCollider:
m_ObjectHideFlags: 0
@ -130094,7 +130208,7 @@ MeshRenderer:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1632119359}
m_Enabled: 1
m_Enabled: 0
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
@ -167589,6 +167703,14 @@ PrefabInstance:
propertyPath: shache.Array.size
value: 3
objectReference: {fileID: 0}
- target: {fileID: 1276762318, guid: 4292160a5e1fde347934ac660b2c5d30, type: 3}
propertyPath: shache.Array.data[0]
value:
objectReference: {fileID: 469820069}
- target: {fileID: 1276762318, guid: 4292160a5e1fde347934ac660b2c5d30, type: 3}
propertyPath: shache.Array.data[1]
value:
objectReference: {fileID: 2009850704}
- target: {fileID: 1276762318, guid: 4292160a5e1fde347934ac660b2c5d30, type: 3}
propertyPath: shache.Array.data[2]
value:

View File

@ -16,13 +16,18 @@ public class AccidentManager : MonoBehaviour
public Animation zuiwei;
public Animator diandongcheren;
void Close()
public void Close()
{
for (int i = 0; i < uis.transform.Find("UI").childCount; i++)
{
uis.transform.Find("UI").GetChild(i).gameObject.SetActive(false);
}
for (int i = 0; i < baotai.Length; i++)
{
baotai[i].SetActive(false);
}
zuiwei.gameObject.SetActive(false);
diandongcheren.gameObject.SetActive(false);
}
@ -34,33 +39,35 @@ public class AccidentManager : MonoBehaviour
if (other.transform.tag == "People")
{ await Task.Delay(TimeSpan.FromSeconds(1));
{ await Task.Delay(TimeSpan.FromSeconds(2));
Close();
uis.SetActive(true);
uis.transform.Find("UI").Find("撞倒行人").gameObject.SetActive(true);
}
else if (other.name == "Box_Collider")
{ await Task.Delay(TimeSpan.FromSeconds(1));
{ await Task.Delay(TimeSpan.FromSeconds(2));
Close();
uis.SetActive(true);
uis.transform.Find("UI").Find("汽车追尾").gameObject.SetActive(true);
}
else if (other.name == "爆胎")
{ await Task.Delay(TimeSpan.FromSeconds(1));
Close();
uis.SetActive(true);
uis.transform.Find("UI").Find("爆胎").gameObject.SetActive(true);
{
for (int i = 0; i < baotai.Length; i++)
{
baotai[i].SetActive(true);
}
await Task.Delay(TimeSpan.FromSeconds(2));
Close();
uis.SetActive(true);
uis.transform.Find("UI").Find("爆胎").gameObject.SetActive(true);
}
else if (other.name == "礼让行人")
{
if (b)
{
await Task.Delay(TimeSpan.FromSeconds(1));
await Task.Delay(TimeSpan.FromSeconds(2));
Close();
uis.SetActive(true);
uis.transform.Find("UI").Find("礼让行人").gameObject.SetActive(true);
@ -80,7 +87,7 @@ public class AccidentManager : MonoBehaviour
StartCoroutine(diandongche());
}
else if (other.name == "刹车失灵")
{ await Task.Delay(TimeSpan.FromSeconds(1));
{ await Task.Delay(TimeSpan.FromSeconds(2));
Close();
uis.SetActive(true);
uis.transform.Find("UI").Find("刹车失灵").gameObject.SetActive(true);

View File

@ -60,7 +60,7 @@ namespace Script
vehicleController = GetComponent<VehicleController>();
vehicleStandardInput = GetComponent<VehicleStandardInput>();
// StartModbus();
StartModbus();
ModBusQueue();
}
@ -92,17 +92,17 @@ namespace Script
while (true)
{
// Debug.Log(client.modbusQueue.Count);
// if (client.modbusQueue.Count > 0)
// {
// // Debug.Log(client.modbusQueue.Count);
//
// carData = client.modbusQueue.Dequeue();
if (ModbusTcpClient.modbusTcpClient.modbusQueue.Count > 0)
if (client.modbusQueue.Count > 0)
{
// Debug.Log(ModbusTcpClient.modbusTcpClient.modbusQueue.Count);
// Debug.Log(client.modbusQueue.Count);
carData = ModbusTcpClient.modbusTcpClient.modbusQueue.Dequeue();
carData = client.modbusQueue.Dequeue();
// if (ModbusTcpClient.modbusTcpClient.modbusQueue.Count > 0)
// {
// // Debug.Log(ModbusTcpClient.modbusTcpClient.modbusQueue.Count);
//
// carData = ModbusTcpClient.modbusTcpClient.modbusQueue.Dequeue();
//方向盘

View File

@ -0,0 +1,77 @@
Using pre-set license
Built from '2021.1/staging' branch; Version is '2021.1.24f1 (6667702a1e7c) revision 6711152'; Using compiler version '192528614'; Build Type 'Release'
OS: 'Windows 10 Pro; OS build 19044.1682; Version 2009; 64bit' Language: 'zh' Physical Memory: 16197 MB
BatchMode: 1, IsHumanControllingUs: 0, StartBugReporterOnCrash: 0, Is64bit: 1, IsPro: 0
COMMAND LINE ARGUMENTS:
D:\2021.1.24f1\Editor\Unity.exe
-adb2
-batchMode
-noUpm
-name
AssetImportWorker0
-projectPath
E:/Unity Projects/GitLab/2023/H_SafeExperienceDrivingSystem/U3D_DrivingSystem
-logFile
Logs/AssetImportWorker0.log
-srvPort
54874
Successfully changed project path to: E:/Unity Projects/GitLab/2023/H_SafeExperienceDrivingSystem/U3D_DrivingSystem
E:/Unity Projects/GitLab/2023/H_SafeExperienceDrivingSystem/U3D_DrivingSystem
Using Asset Import Pipeline V2.
Refreshing native plugins compatible for Editor in 193.03 ms, found 8 plugins.
Preloading 0 native plugins for Editor in 0.00 ms.
Initialize engine version: 2021.1.24f1 (6667702a1e7c)
[Subsystems] Discovering subsystems at path D:/2021.1.24f1/Editor/Data/Resources/UnitySubsystems
[Subsystems] Discovering subsystems at path E:/Unity Projects/GitLab/2023/H_SafeExperienceDrivingSystem/U3D_DrivingSystem/Assets
GfxDevice: creating device client; threaded=0; jobified=0
Direct3D:
Version: Direct3D 11.0 [level 11.1]
Renderer: NVIDIA GeForce GTX 1660 SUPER (ID=0x21c4)
Vendor: NVIDIA
VRAM: 5981 MB
Driver: 31.0.15.4617
Shader 'Custom/EVP Particles Alpha Blended Shadows': fallback shader 'Particles/Alpha Blended' not found
Initialize mono
Mono path[0] = 'D:/2021.1.24f1/Editor/Data/Managed'
Mono path[1] = 'D:/2021.1.24f1/Editor/Data/MonoBleedingEdge/lib/mono/unityjit'
Mono config path = 'D:/2021.1.24f1/Editor/Data/MonoBleedingEdge/etc'
Using monoOptions --debugger-agent=transport=dt_socket,embedding=1,server=y,suspend=n,address=127.0.0.1:56444
Begin MonoManager ReloadAssembly
Registering precompiled unity dll's ...
Register platform support module: D:/2021.1.24f1/Editor/Data/PlaybackEngines/WindowsStandaloneSupport/UnityEditor.WindowsStandalone.Extensions.dll
Registered in 0.001787 seconds.
Native extension for WindowsStandalone target not found
Refreshing native plugins compatible for Editor in 194.30 ms, found 8 plugins.
Preloading 0 native plugins for Editor in 0.00 ms.
Mono: successfully reloaded assembly
- Completed reload, in 1.671 seconds
Domain Reload Profiling:
ReloadAssembly (1671ms)
BeginReloadAssembly (84ms)
ExecutionOrderSort (0ms)
DisableScriptedObjects (0ms)
BackupInstance (0ms)
ReleaseScriptingObjects (0ms)
CreateAndSetChildDomain (1ms)
EndReloadAssembly (617ms)
LoadAssemblies (83ms)
RebuildTransferFunctionScriptingTraits (0ms)
SetupTypeCache (161ms)
ReleaseScriptCaches (0ms)
RebuildScriptCaches (34ms)
SetupLoadedEditorAssemblies (373ms)
LogAssemblyErrors (0ms)
InitializePlatformSupportModulesInManaged (7ms)
SetLoadedEditorAssemblies (0ms)
RefreshPlugins (194ms)
BeforeProcessingInitializeOnLoad (2ms)
ProcessInitializeOnLoadAttributes (106ms)
ProcessInitializeOnLoadMethodAttributes (64ms)
AfterProcessingInitializeOnLoad (0ms)
EditorAssembliesLoaded (0ms)
ExecutionOrderSort2 (0ms)
AwakeInstancesAfterBackupRestoration (0ms)
Platform modules already initialized, skipping
Registering precompiled user dll's ...
Registered in 0.332903 seconds.

View File

@ -0,0 +1,77 @@
Using pre-set license
Built from '2021.1/staging' branch; Version is '2021.1.24f1 (6667702a1e7c) revision 6711152'; Using compiler version '192528614'; Build Type 'Release'
OS: 'Windows 10 Pro; OS build 19044.1682; Version 2009; 64bit' Language: 'zh' Physical Memory: 16197 MB
BatchMode: 1, IsHumanControllingUs: 0, StartBugReporterOnCrash: 0, Is64bit: 1, IsPro: 0
COMMAND LINE ARGUMENTS:
D:\2021.1.24f1\Editor\Unity.exe
-adb2
-batchMode
-noUpm
-name
AssetImportWorker1
-projectPath
E:/Unity Projects/GitLab/2023/H_SafeExperienceDrivingSystem/U3D_DrivingSystem
-logFile
Logs/AssetImportWorker1.log
-srvPort
54874
Successfully changed project path to: E:/Unity Projects/GitLab/2023/H_SafeExperienceDrivingSystem/U3D_DrivingSystem
E:/Unity Projects/GitLab/2023/H_SafeExperienceDrivingSystem/U3D_DrivingSystem
Using Asset Import Pipeline V2.
Refreshing native plugins compatible for Editor in 195.15 ms, found 8 plugins.
Preloading 0 native plugins for Editor in 0.00 ms.
Initialize engine version: 2021.1.24f1 (6667702a1e7c)
[Subsystems] Discovering subsystems at path D:/2021.1.24f1/Editor/Data/Resources/UnitySubsystems
[Subsystems] Discovering subsystems at path E:/Unity Projects/GitLab/2023/H_SafeExperienceDrivingSystem/U3D_DrivingSystem/Assets
GfxDevice: creating device client; threaded=0; jobified=0
Direct3D:
Version: Direct3D 11.0 [level 11.1]
Renderer: NVIDIA GeForce GTX 1660 SUPER (ID=0x21c4)
Vendor: NVIDIA
VRAM: 5981 MB
Driver: 31.0.15.4617
Shader 'Custom/EVP Particles Alpha Blended Shadows': fallback shader 'Particles/Alpha Blended' not found
Initialize mono
Mono path[0] = 'D:/2021.1.24f1/Editor/Data/Managed'
Mono path[1] = 'D:/2021.1.24f1/Editor/Data/MonoBleedingEdge/lib/mono/unityjit'
Mono config path = 'D:/2021.1.24f1/Editor/Data/MonoBleedingEdge/etc'
Using monoOptions --debugger-agent=transport=dt_socket,embedding=1,server=y,suspend=n,address=127.0.0.1:56208
Begin MonoManager ReloadAssembly
Registering precompiled unity dll's ...
Register platform support module: D:/2021.1.24f1/Editor/Data/PlaybackEngines/WindowsStandaloneSupport/UnityEditor.WindowsStandalone.Extensions.dll
Registered in 0.000894 seconds.
Native extension for WindowsStandalone target not found
Refreshing native plugins compatible for Editor in 205.91 ms, found 8 plugins.
Preloading 0 native plugins for Editor in 0.00 ms.
Mono: successfully reloaded assembly
- Completed reload, in 1.397 seconds
Domain Reload Profiling:
ReloadAssembly (1397ms)
BeginReloadAssembly (59ms)
ExecutionOrderSort (0ms)
DisableScriptedObjects (0ms)
BackupInstance (0ms)
ReleaseScriptingObjects (0ms)
CreateAndSetChildDomain (1ms)
EndReloadAssembly (676ms)
LoadAssemblies (56ms)
RebuildTransferFunctionScriptingTraits (0ms)
SetupTypeCache (205ms)
ReleaseScriptCaches (0ms)
RebuildScriptCaches (36ms)
SetupLoadedEditorAssemblies (382ms)
LogAssemblyErrors (0ms)
InitializePlatformSupportModulesInManaged (7ms)
SetLoadedEditorAssemblies (0ms)
RefreshPlugins (206ms)
BeforeProcessingInitializeOnLoad (2ms)
ProcessInitializeOnLoadAttributes (127ms)
ProcessInitializeOnLoadMethodAttributes (39ms)
AfterProcessingInitializeOnLoad (0ms)
EditorAssembliesLoaded (0ms)
ExecutionOrderSort2 (0ms)
AwakeInstancesAfterBackupRestoration (0ms)
Platform modules already initialized, skipping
Registering precompiled user dll's ...
Registered in 0.007415 seconds.

View File

@ -18,10 +18,10 @@ EditorUserSettings:
value: 224247031146460a5c5f42371e2a4b09
flags: 0
RecentlyUsedScenePath-4:
value: 22424703114646680e0b0227036c52111f19276439262f2434
value: 22424703114646680e0b0227036c4c0417050c6439262f2434
flags: 0
RecentlyUsedScenePath-5:
value: 22424703114646680e0b0227036c4c0417050c6439262f2434
value: 22424703114646680e0b0227036c52111f19276439262f2434
flags: 0
vcSharedLogLevel:
value: 0d5e400f0650