This commit is contained in:
yzx 2023-12-25 13:32:51 +08:00
parent 22f4c96753
commit bfa68c7f04
13 changed files with 8523 additions and 11810 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,79 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: "\u7EA2\u7EFF\u706F\u6570\u5B57"
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: ed962fbd11b18d84e87088546760de05, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 0.8, g: 0.8, b: 0.8, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
m_BuildTextureStacks: []

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 153c7844296ef2144b984e2e99129767
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -42,14 +42,15 @@ namespace Script
public TurnSignalController turnSignalController;
private bool inputUp = false;
private int inputUpV=-1;
private int inputUpV = -1;
public GameObject uiGame;
void Start()
{
vehicleController = GetComponent<VehicleController>();
vehicleStandardInput = GetComponent<VehicleStandardInput>();
// StartModbus();
StartModbus();
ModBusQueue();
}
@ -62,14 +63,15 @@ namespace Script
await client.SendModbusRequest();
await Task.Delay(TimeSpan.FromSeconds(.1));
}
}
}
public void HHHHHH()
{
client.SendModbusRequest12();
client.SendModbusRequest12();
}
void OnDestroy()
{
client.CloseConnection();
@ -80,17 +82,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();
//方向盘
@ -170,7 +172,6 @@ namespace Script
{
NewValue = carData.ButtonData;
CarMenuButton(NewValue);
}
// else
// {
@ -188,12 +189,24 @@ namespace Script
}
//转向灯和双闪
if (carData.ButtonData == 1)
{
inputUpV = carData.TurnSignalStatus;
if (!inputUp)
{
inputUp = true;
inputUpV = carData.TurnSignalStatus;
}
else
{
inputUp = false;
inputUpV = -1;
turnSignalController.rightTurnSignalGame.SetActive(false);
turnSignalController.leftTurnSignalGame.SetActive(false);
turnSignalController.SetSignal(0);
}
}
if ( inputUpV == carData.TurnSignalStatus)
if (inputUpV == carData.TurnSignalStatus)
{
turnSignalController.SetSignal(3);
}
@ -209,25 +222,43 @@ namespace Script
turnSignalController.SetSignal(1);
break;
case 2:
turnSignalController.SetSignal(2);
turnSignalController.SetSignal(2);
break;
}
}
// 灯光
switch (carData.LightStatus)
{
case 0:
turnSignalController.CloseLight();
break;
case 1:
turnSignalController.OpenLight();
break;
case 2:
break;
}
switch (carData.LightStatus)
{
case 0:
turnSignalController.CloseLight();
break;
case 1:
turnSignalController.OpenLight();
break;
case 2:
break;
}
//钥匙 00是熄火1是通电2是点火
switch (carData.KeyStatus)
{
case 0:
uiGame.SetActive(false);
break;
case 1:
break;
case 2:
if (carData.BrakePedalPosition > 30)
{
uiGame.SetActive(true);
currentGear = 1;
}
break;
}
//刹车
if (carData.BrakePedalPosition > 30)
@ -240,11 +271,11 @@ namespace Script
}
}
else
{
{
if (!shache[0].activeInHierarchy)
continue;
for (int i = 0; i < shache.Length; i++)
{
continue;
for (int i = 0; i < shache.Length; i++)
{
shache[i].SetActive(false);
}
}

View File

@ -35,10 +35,10 @@ public class TurnSignalController : MonoBehaviour
cancellationTokenSource.Dispose();
// HighBeamLight.SetActive(false);
// LowBeamLight.SetActive(false);
// rightTurnSignalGame.SetActive(false);
// leftTurnSignalGame.SetActive(false);
}
cancellationTokenSource = new CancellationTokenSource();
@ -126,7 +126,7 @@ public class TurnSignalController : MonoBehaviour
rightTurnSignal.SetActive(false);
}
private void StopAllSignals()
public void StopAllSignals()
{
if (cancellationTokenSource != null)
{

File diff suppressed because it is too large Load Diff

View File

@ -1,77 +0,0 @@
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
56965
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.67 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:56244
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.000960 seconds.
Native extension for WindowsStandalone target not found
Refreshing native plugins compatible for Editor in 197.54 ms, found 8 plugins.
Preloading 0 native plugins for Editor in 0.00 ms.
Mono: successfully reloaded assembly
- Completed reload, in 1.832 seconds
Domain Reload Profiling:
ReloadAssembly (1832ms)
BeginReloadAssembly (75ms)
ExecutionOrderSort (0ms)
DisableScriptedObjects (0ms)
BackupInstance (0ms)
ReleaseScriptingObjects (0ms)
CreateAndSetChildDomain (1ms)
EndReloadAssembly (645ms)
LoadAssemblies (73ms)
RebuildTransferFunctionScriptingTraits (0ms)
SetupTypeCache (172ms)
ReleaseScriptCaches (0ms)
RebuildScriptCaches (36ms)
SetupLoadedEditorAssemblies (385ms)
LogAssemblyErrors (0ms)
InitializePlatformSupportModulesInManaged (7ms)
SetLoadedEditorAssemblies (0ms)
RefreshPlugins (198ms)
BeforeProcessingInitializeOnLoad (2ms)
ProcessInitializeOnLoadAttributes (114ms)
ProcessInitializeOnLoadMethodAttributes (64ms)
AfterProcessingInitializeOnLoad (0ms)
EditorAssembliesLoaded (0ms)
ExecutionOrderSort2 (0ms)
AwakeInstancesAfterBackupRestoration (0ms)
Platform modules already initialized, skipping
Registering precompiled user dll's ...
Registered in 0.006784 seconds.

File diff suppressed because it is too large Load Diff

View File

@ -1,77 +0,0 @@
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
56965
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 187.97 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:56472
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.001060 seconds.
Native extension for WindowsStandalone target not found
Refreshing native plugins compatible for Editor in 194.45 ms, found 8 plugins.
Preloading 0 native plugins for Editor in 0.00 ms.
Mono: successfully reloaded assembly
- Completed reload, in 1.220 seconds
Domain Reload Profiling:
ReloadAssembly (1220ms)
BeginReloadAssembly (57ms)
ExecutionOrderSort (0ms)
DisableScriptedObjects (0ms)
BackupInstance (0ms)
ReleaseScriptingObjects (0ms)
CreateAndSetChildDomain (1ms)
EndReloadAssembly (590ms)
LoadAssemblies (56ms)
RebuildTransferFunctionScriptingTraits (0ms)
SetupTypeCache (161ms)
ReleaseScriptCaches (0ms)
RebuildScriptCaches (35ms)
SetupLoadedEditorAssemblies (343ms)
LogAssemblyErrors (0ms)
InitializePlatformSupportModulesInManaged (7ms)
SetLoadedEditorAssemblies (0ms)
RefreshPlugins (195ms)
BeforeProcessingInitializeOnLoad (2ms)
ProcessInitializeOnLoadAttributes (108ms)
ProcessInitializeOnLoadMethodAttributes (32ms)
AfterProcessingInitializeOnLoad (0ms)
EditorAssembliesLoaded (0ms)
ExecutionOrderSort2 (0ms)
AwakeInstancesAfterBackupRestoration (0ms)
Platform modules already initialized, skipping
Registering precompiled user dll's ...
Registered in 0.006552 seconds.

View File

@ -1,3 +0,0 @@
Base path: 'D:/2021.1.24f1/Editor/Data', plugins path 'D:/2021.1.24f1/Editor/Data/PlaybackEngines'
Cmd: initializeCompiler

View File

@ -1,2 +1,2 @@
m_EditorVersion: 2019.4.0f1
m_EditorVersionWithRevision: 2019.4.0f1 (0af376155913)
m_EditorVersion: 2021.1.24f1
m_EditorVersionWithRevision: 2021.1.24f1 (6667702a1e7c)