2024.1.11修改
This commit is contained in:
parent
d8f0f8fce5
commit
c338f9a943
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -117,7 +117,7 @@ AnimatorStateMachine:
|
|||
m_Position: {x: 280, y: 90, z: 0}
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: -8544622712409694287}
|
||||
m_Position: {x: 280, y: 160, z: 0}
|
||||
m_Position: {x: 200, y: 170, z: 0}
|
||||
m_ChildStateMachines: []
|
||||
m_AnyStateTransitions: []
|
||||
m_EntryTransitions: []
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
|
@ -135,7 +135,9 @@ ModelImporter:
|
|||
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
|
||||
blendShapeNormalImportMode: 1
|
||||
normalSmoothingSource: 0
|
||||
referencedClips: []
|
||||
referencedClips:
|
||||
- 2c62a56fa94e1324b8757321b3ae70ea
|
||||
- 89da1f866ff1da145897b37cdfe25d94
|
||||
importAnimation: 1
|
||||
humanDescription:
|
||||
serializedVersion: 3
|
||||
|
|
|
|||
|
|
@ -75,7 +75,9 @@ ModelImporter:
|
|||
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
|
||||
blendShapeNormalImportMode: 1
|
||||
normalSmoothingSource: 0
|
||||
referencedClips: []
|
||||
referencedClips:
|
||||
- 2c62a56fa94e1324b8757321b3ae70ea
|
||||
- 89da1f866ff1da145897b37cdfe25d94
|
||||
importAnimation: 1
|
||||
humanDescription:
|
||||
serializedVersion: 3
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 775 KiB |
|
|
@ -0,0 +1,108 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 7a67609e5708d3b46a3d3572bdc11e9e
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 11
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 0
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 786 KiB |
|
|
@ -0,0 +1,108 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 568b07955e35819418050764c989a2ff
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 11
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 0
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -146,6 +146,9 @@ public class AccidentManager : MonoBehaviour
|
|||
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{
|
||||
//
|
||||
//MBOXManager.Instance.Bonk();
|
||||
|
||||
Tr(other.transform);
|
||||
|
||||
// switch (other.name)
|
||||
|
|
@ -193,6 +196,7 @@ public class AccidentManager : MonoBehaviour
|
|||
// 用于外部调用的方法,启动动画序列
|
||||
public void PlayAnimationSequence(string firstAnimation, string secondAnimation)
|
||||
{
|
||||
Close();
|
||||
if (!isPlaying)
|
||||
{
|
||||
Debug.Log("12312312312312312321");
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ namespace Script
|
|||
{
|
||||
using ModbusManager;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Unity.VisualScripting;
|
||||
using UnityEngine;
|
||||
|
|
@ -21,7 +23,8 @@ namespace Script
|
|||
|
||||
private VehicleStandardInput vehicleStandardInput;
|
||||
public int currentGear = 0; // 当前挡位
|
||||
public float[] gearSpeeds = { 0f, 20f, 40f, 60f }; // 每个挡位的最大速度
|
||||
//public float[] gearSpeeds = { 0f, 20f, 40f, 60f }; // 每个挡位的最大速度
|
||||
public List<float> gearSpeeds; // 每个挡位的最大速度
|
||||
|
||||
public float xx;
|
||||
float steerInput, throttleInput, brakeInput, handbrakeInput;
|
||||
|
|
@ -64,14 +67,62 @@ namespace Script
|
|||
|
||||
private bool dianhuo = false;
|
||||
|
||||
private Coroutine currentCoroutine = null; // 当前正在运行的协程
|
||||
private int lastEndIndex = 0; // 上一次的结束索引
|
||||
private int currentEndIndex = 0; // 当前的结束索引
|
||||
|
||||
public bool isShache = false;
|
||||
public void LoadData()
|
||||
{
|
||||
gearSpeeds = new List<float>();
|
||||
int originalCount = 21;
|
||||
int targetCount = 100;
|
||||
int interval = (targetCount - 1) / (originalCount - 1);
|
||||
|
||||
for (int i = 1; i <= originalCount; i++)
|
||||
{
|
||||
float startValue = i;
|
||||
gearSpeeds.Add(startValue);
|
||||
|
||||
if (i < originalCount)
|
||||
{
|
||||
float endValue = i + 1;
|
||||
for (int j = 1; j < interval; j++)
|
||||
{
|
||||
|
||||
float interpolatedValue = startValue + (endValue - startValue) * j / interval;
|
||||
gearSpeeds.Add(interpolatedValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
gearSpeeds[0] = 0;
|
||||
gearSpeeds[1] = 0;
|
||||
gearSpeeds[2] = 0;
|
||||
gearSpeeds[3] = 0;
|
||||
gearSpeeds[4] = 0;
|
||||
gearSpeeds[5] = 0;
|
||||
gearSpeeds[6] = 0;
|
||||
gearSpeeds[7] = 0;
|
||||
gearSpeeds[8] = 0;
|
||||
gearSpeeds[9] = 0;
|
||||
gearSpeeds[10] = 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
void Start()
|
||||
{
|
||||
|
||||
LoadData();
|
||||
|
||||
vehicleController = GetComponent<VehicleController>();
|
||||
vehicleStandardInput = GetComponent<VehicleStandardInput>();
|
||||
|
||||
StartModbus();
|
||||
ModBusQueue();
|
||||
|
||||
|
||||
}
|
||||
|
||||
async Task StartModbus()
|
||||
|
|
@ -124,21 +175,7 @@ namespace Script
|
|||
//方向盘
|
||||
vehicleController.steerInput = NormalizeValue(carData.SteeringWheelAngle, minValue, maxValue);
|
||||
|
||||
//当转向没有打灯就弹窗
|
||||
if (carData.SteeringWheelAngle > 200)
|
||||
{
|
||||
if (turnSignalController.turnSignalState != TurnSignalState.右转向)
|
||||
{
|
||||
accidentManager.PlayAnimationSequence("MsgWinAnimOpen", "MsgWinAnimClose");
|
||||
}
|
||||
}
|
||||
else if (carData.SteeringWheelAngle < -200)
|
||||
{
|
||||
if (turnSignalController.turnSignalState != TurnSignalState.左转向)
|
||||
{
|
||||
accidentManager.PlayAnimationSequence("MsgWinAnimOpen", "MsgWinAnimClose");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//钥匙 00是熄火,1是通电,2是点火
|
||||
|
|
@ -153,7 +190,7 @@ namespace Script
|
|||
if (carData.BrakePedalPosition > 30)
|
||||
{
|
||||
uiGame.SetActive(true);
|
||||
currentGear = 1;
|
||||
currentGear = 0;
|
||||
dianhuo = true;
|
||||
ui2d.SetActive(true);
|
||||
}
|
||||
|
|
@ -173,30 +210,72 @@ namespace Script
|
|||
switch (carData.GearPosition)
|
||||
{
|
||||
case 0:
|
||||
vehicleController.throttleInput = 0;
|
||||
currentGear = 0;
|
||||
break;
|
||||
case 1: //1前进档
|
||||
if (carData.HandbrakeStatus == 0)
|
||||
{
|
||||
if (carData.AcceleratorPedalPosition > 20 && carData.AcceleratorPedalPosition <= 50)
|
||||
{
|
||||
vehicleController.throttleInput = 1;
|
||||
currentGear = 1;
|
||||
}
|
||||
else if (carData.AcceleratorPedalPosition > 50 && carData.AcceleratorPedalPosition <= 80)
|
||||
{
|
||||
vehicleController.throttleInput = 1;
|
||||
currentGear = 2;
|
||||
}
|
||||
else if (carData.AcceleratorPedalPosition > 80 && carData.AcceleratorPedalPosition <= 100)
|
||||
{
|
||||
vehicleController.throttleInput = 1;
|
||||
currentGear = 3;
|
||||
}
|
||||
else
|
||||
//if (carData.AcceleratorPedalPosition > 20 && carData.AcceleratorPedalPosition <= 50)
|
||||
//{
|
||||
// vehicleController.throttleInput = 1;
|
||||
// currentGear = 1;
|
||||
//}
|
||||
//else if (carData.AcceleratorPedalPosition > 50 && carData.AcceleratorPedalPosition <= 80)
|
||||
//{
|
||||
// vehicleController.throttleInput = 1;
|
||||
// currentGear = 2;
|
||||
//}
|
||||
//else if (carData.AcceleratorPedalPosition > 80 && carData.AcceleratorPedalPosition <= 100)
|
||||
//{
|
||||
// vehicleController.throttleInput = 1;
|
||||
// currentGear = 3;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// vehicleController.throttleInput = 0;
|
||||
// currentGear = 0;
|
||||
//}
|
||||
|
||||
|
||||
if (carData.AcceleratorPedalPosition < 10)
|
||||
{
|
||||
vehicleController.throttleInput = 0;
|
||||
currentGear = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
vehicleController.throttleInput = 1;
|
||||
currentGear = carData.AcceleratorPedalPosition;
|
||||
currentEndIndex = currentGear;
|
||||
|
||||
if (currentEndIndex != lastEndIndex)
|
||||
{
|
||||
float totalDuration = currentEndIndex < lastEndIndex ? 5.0f : 2.0f;
|
||||
StartRetrieveData(lastEndIndex, currentEndIndex, totalDuration);
|
||||
lastEndIndex = currentEndIndex;
|
||||
}
|
||||
}
|
||||
//当转向没有打灯就弹窗
|
||||
if (carData.SteeringWheelAngle > 200)
|
||||
{
|
||||
if (turnSignalController.turnSignalState != TurnSignalState.右转向)
|
||||
{
|
||||
accidentManager.PlayAnimationSequence("MsgWinAnimOpen", "MsgWinAnimClose");
|
||||
accidentManager.uis.transform.Find("UI/转向").gameObject.SetActive(true);
|
||||
|
||||
}
|
||||
}
|
||||
else if (carData.SteeringWheelAngle < -200)
|
||||
{
|
||||
if (turnSignalController.turnSignalState != TurnSignalState.左转向)
|
||||
{
|
||||
accidentManager.PlayAnimationSequence("MsgWinAnimOpen", "MsgWinAnimClose");
|
||||
accidentManager.uis.transform.Find("UI/转向").gameObject.SetActive(true);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -350,6 +429,7 @@ namespace Script
|
|||
// }
|
||||
// else
|
||||
// {
|
||||
|
||||
//踩离合弹出菜单UI
|
||||
if (carData.ClutchPedalPosition > 30)
|
||||
{
|
||||
|
|
@ -387,13 +467,18 @@ namespace Script
|
|||
{
|
||||
if (shache[0].activeInHierarchy)
|
||||
continue;
|
||||
|
||||
isShache = true;
|
||||
for (int i = 0; i < shache.Length; i++)
|
||||
{
|
||||
shache[i].SetActive(true);
|
||||
}
|
||||
vehicleController.throttleInput = 0;
|
||||
currentGear = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
isShache = false;
|
||||
if (!shache[0].activeInHierarchy)
|
||||
continue;
|
||||
for (int i = 0; i < shache.Length; i++)
|
||||
|
|
@ -413,7 +498,33 @@ namespace Script
|
|||
}
|
||||
}
|
||||
|
||||
public void StartRetrieveData(int startIndex, int endIndex, float totalDuration)
|
||||
{
|
||||
if (currentCoroutine != null)
|
||||
{
|
||||
StopCoroutine(currentCoroutine);
|
||||
}
|
||||
|
||||
// 跳过前三个元素
|
||||
startIndex = Mathf.Max(startIndex, 3);
|
||||
|
||||
currentCoroutine = StartCoroutine(RetrieveData(startIndex, endIndex, totalDuration));
|
||||
}
|
||||
|
||||
IEnumerator RetrieveData(int startIndex, int endIndex, float totalDuration)
|
||||
{
|
||||
// 确定遍历方向
|
||||
int step = startIndex < endIndex ? 1 : -1;
|
||||
int count = Mathf.Abs(endIndex - startIndex) + 1;
|
||||
float delay = totalDuration / count;
|
||||
|
||||
for (int i = startIndex; step > 0 ? i <= endIndex : i >= endIndex; i += step)
|
||||
{
|
||||
yield return new WaitForSeconds(delay);
|
||||
}
|
||||
|
||||
currentCoroutine = null;
|
||||
}
|
||||
void CarMenuButton(int bt)
|
||||
{
|
||||
if (bt == 3)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,17 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Unity.VisualScripting;
|
||||
using UnityEngine;
|
||||
|
||||
public class CarBoxColManager : MonoBehaviour
|
||||
{
|
||||
|
||||
|
||||
void OnCollisionEnter(Collision collision)
|
||||
{
|
||||
|
||||
Debug.Log("aaaaaaaaaaaaaaaaaaaaaaaaaaaa" + collision.gameObject.name);
|
||||
// 在这里添加碰撞开始时的处理逻辑
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 5496424003431364a806b76f9068ac1c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -193,7 +193,7 @@ public class MBOXManager : MonoBehaviour
|
|||
ElectricCylinder.U32OneTurnPulseNum = (uint)10000; //一圈脉冲数
|
||||
ElectricCylinder.F32Gear = (float)1.0000; //减速比
|
||||
HostUDPPort = new UdpClient(UdpAppData.I16HostTxPort);
|
||||
IPEndPoint ipendpoint = new IPEndPoint(IPAddress.Any, UdpAppData.I16MboxRxPort);
|
||||
IPEndPoint ipendpoint = new IPEndPoint(IPAddress.Parse("192.168.15.201"), UdpAppData.I16MboxRxPort);
|
||||
HostUDPPort.Connect("255.255.255.255", UdpAppData.I16MboxRxPort);
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,10 @@ namespace Script
|
|||
|
||||
public VehicleController vehicleController;
|
||||
|
||||
public GameObject ui;
|
||||
//public GameObject ui;
|
||||
|
||||
|
||||
public AccidentManager accidentManager;
|
||||
|
||||
private IEnumerator Start()
|
||||
{
|
||||
|
|
@ -31,33 +34,42 @@ namespace Script
|
|||
case "超速60":
|
||||
if (Convert.ToInt32((vehicleController.speed * 3.6f)) > 60)
|
||||
{
|
||||
if (!ui.activeInHierarchy)
|
||||
{
|
||||
ui.SetActive(true);
|
||||
ui.transform.Find("Text").GetComponent<TMP_Text>().text = "超速在影响车辆的安全性能;影响驾驶人及时、准确地操作;会使驾驶人的思维判断失误;给注意力转移带来困难;对速度的判断能力下降;减弱了驾驶人对空间的认识能力。";
|
||||
}
|
||||
|
||||
|
||||
accidentManager.PlayAnimationSequence("MsgWinAnimOpen", "MsgWinAnimClose");
|
||||
accidentManager.uis.transform.Find("UI/超速").gameObject.SetActive(true);
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
case "超速40":
|
||||
if (Convert.ToInt32((vehicleController.speed * 3.6f)) > 40)
|
||||
{
|
||||
if (!ui.activeInHierarchy)
|
||||
{
|
||||
ui.SetActive(true);
|
||||
ui.transform.Find("Text").GetComponent<TMP_Text>().text = "超速在影响车辆的安全性能;影响驾驶人及时、准确地操作;会使驾驶人的思维判断失误;给注意力转移带来困难;对速度的判断能力下降;减弱了驾驶人对空间的认识能力。";
|
||||
}
|
||||
accidentManager.PlayAnimationSequence("MsgWinAnimOpen", "MsgWinAnimClose");
|
||||
accidentManager.uis.transform.Find("UI/超速").gameObject.SetActive(true);
|
||||
|
||||
|
||||
//if (!ui.activeInHierarchy)
|
||||
//{
|
||||
// ui.SetActive(true);
|
||||
// ui.transform.Find("Text").GetComponent<TMP_Text>().text = "超速在影响车辆的安全性能;影响驾驶人及时、准确地操作;会使驾驶人的思维判断失误;给注意力转移带来困难;对速度的判断能力下降;减弱了驾驶人对空间的认识能力。";
|
||||
//}
|
||||
}
|
||||
|
||||
break;
|
||||
case "禁止停车":
|
||||
if (Convert.ToInt32((vehicleController.speed * 3.6f)) <=1)
|
||||
{
|
||||
if (!ui.activeInHierarchy)
|
||||
{
|
||||
ui.SetActive(true);
|
||||
ui.transform.Find("Text").GetComponent<TMP_Text>().text = "机动车如果在行驶中随意的停放,那么就会导致交通事故也会增加,机动车突然的停车也会使得其他的驾驶员无法做好准备,因此就会将碰撞事故以及追尾意外的发生增加。";
|
||||
}
|
||||
|
||||
accidentManager.PlayAnimationSequence("MsgWinAnimOpen", "MsgWinAnimClose");
|
||||
accidentManager.uis.transform.Find("UI/停车").gameObject.SetActive(true);
|
||||
//accidentManager.uis.transform.Find("UI/停车").GetComponent<TMP_Text>().text = "";
|
||||
|
||||
//if (!ui.activeInHierarchy)
|
||||
//{
|
||||
// ui.SetActive(true);
|
||||
// ui.transform.Find("Text").GetComponent<TMP_Text>().text = "机动车如果在行驶中随意的停放,那么就会导致交通事故也会增加,机动车突然的停车也会使得其他的驾驶员无法做好准备,因此就会将碰撞事故以及追尾意外的发生增加。";
|
||||
//}
|
||||
}
|
||||
|
||||
break;
|
||||
|
|
@ -75,11 +87,17 @@ namespace Script
|
|||
{
|
||||
if (other.name == "触发红灯")
|
||||
{
|
||||
if (!ui.activeInHierarchy)
|
||||
{
|
||||
ui.SetActive(true);
|
||||
ui.transform.Find("Text").GetComponent<TMP_Text>().text = "车辆闯红灯容易导致车辆相撞或者撞到行人,造成严重的交通事故。更可能导致交通秩序混乱,影响其他车辆和行人的正常通行。";
|
||||
}
|
||||
|
||||
accidentManager.PlayAnimationSequence("MsgWinAnimOpen", "MsgWinAnimClose");
|
||||
accidentManager.uis.transform.Find("UI/闯红灯").gameObject.SetActive(true);
|
||||
//accidentManager.uis.transform.Find("UI/闯红灯").GetComponent<TMP_Text>().text = "车辆闯红灯容易导致车辆相撞或者撞到行人,造成严重的交通事故。更可能导致交通秩序混乱,影响其他车辆和行人的正常通行。";
|
||||
|
||||
|
||||
//if (!ui.activeInHierarchy)
|
||||
//{
|
||||
// ui.SetActive(true);
|
||||
// ui.transform.Find("Text").GetComponent<TMP_Text>().text = "车辆闯红灯容易导致车辆相撞或者撞到行人,造成严重的交通事故。更可能导致交通秩序混乱,影响其他车辆和行人的正常通行。";
|
||||
//}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
172.16.1.125,12315
|
||||
192.168.15.100,12315
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -5,14 +5,14 @@
|
|||
"depth": 0,
|
||||
"source": "registry",
|
||||
"dependencies": {},
|
||||
"url": "https://packages.unity.com"
|
||||
"url": "https://packages.unity.cn"
|
||||
},
|
||||
"com.unity.ext.nunit": {
|
||||
"version": "1.0.6",
|
||||
"depth": 1,
|
||||
"source": "registry",
|
||||
"dependencies": {},
|
||||
"url": "https://packages.unity.com"
|
||||
"url": "https://packages.unity.cn"
|
||||
},
|
||||
"com.unity.ide.rider": {
|
||||
"version": "3.0.7",
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
"dependencies": {
|
||||
"com.unity.ext.nunit": "1.0.6"
|
||||
},
|
||||
"url": "https://packages.unity.com"
|
||||
"url": "https://packages.unity.cn"
|
||||
},
|
||||
"com.unity.ide.visualstudio": {
|
||||
"version": "2.0.11",
|
||||
|
|
@ -30,14 +30,14 @@
|
|||
"dependencies": {
|
||||
"com.unity.test-framework": "1.1.9"
|
||||
},
|
||||
"url": "https://packages.unity.com"
|
||||
"url": "https://packages.unity.cn"
|
||||
},
|
||||
"com.unity.ide.vscode": {
|
||||
"version": "1.2.4",
|
||||
"depth": 0,
|
||||
"source": "registry",
|
||||
"dependencies": {},
|
||||
"url": "https://packages.unity.com"
|
||||
"url": "https://packages.unity.cn"
|
||||
},
|
||||
"com.unity.postprocessing": {
|
||||
"version": "3.1.1",
|
||||
|
|
@ -46,7 +46,7 @@
|
|||
"dependencies": {
|
||||
"com.unity.modules.physics": "1.0.0"
|
||||
},
|
||||
"url": "https://packages.unity.com"
|
||||
"url": "https://packages.unity.cn"
|
||||
},
|
||||
"com.unity.test-framework": {
|
||||
"version": "1.1.29",
|
||||
|
|
@ -57,7 +57,7 @@
|
|||
"com.unity.modules.imgui": "1.0.0",
|
||||
"com.unity.modules.jsonserialize": "1.0.0"
|
||||
},
|
||||
"url": "https://packages.unity.com"
|
||||
"url": "https://packages.unity.cn"
|
||||
},
|
||||
"com.unity.textmeshpro": {
|
||||
"version": "3.0.6",
|
||||
|
|
@ -66,7 +66,7 @@
|
|||
"dependencies": {
|
||||
"com.unity.ugui": "1.0.0"
|
||||
},
|
||||
"url": "https://packages.unity.com"
|
||||
"url": "https://packages.unity.cn"
|
||||
},
|
||||
"com.unity.timeline": {
|
||||
"version": "1.5.6",
|
||||
|
|
@ -78,7 +78,7 @@
|
|||
"com.unity.modules.audio": "1.0.0",
|
||||
"com.unity.modules.particlesystem": "1.0.0"
|
||||
},
|
||||
"url": "https://packages.unity.com"
|
||||
"url": "https://packages.unity.cn"
|
||||
},
|
||||
"com.unity.ugui": {
|
||||
"version": "1.0.0",
|
||||
|
|
@ -102,7 +102,7 @@
|
|||
"com.unity.modules.physics": "1.0.0",
|
||||
"com.unity.modules.physics2d": "1.0.0"
|
||||
},
|
||||
"url": "https://packages.unity.com"
|
||||
"url": "https://packages.unity.cn"
|
||||
},
|
||||
"com.unity.modules.ai": {
|
||||
"version": "1.0.0",
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ MonoBehaviour:
|
|||
m_Registries:
|
||||
- m_Id: main
|
||||
m_Name:
|
||||
m_Url: https://packages.unity.com
|
||||
m_Url: https://packages.unity.cn
|
||||
m_Scopes: []
|
||||
m_IsDefault: 1
|
||||
m_Capabilities: 7
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
m_EditorVersion: 2021.1.24f1
|
||||
m_EditorVersionWithRevision: 2021.1.24f1 (6667702a1e7c)
|
||||
m_EditorVersion: 2021.1.24f1c1
|
||||
m_EditorVersionWithRevision: 2021.1.24f1c1 (cd7332aabd05)
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ UnityConnectSettings:
|
|||
m_EventUrl: https://cdp.cloud.unity3d.com/v1/events
|
||||
m_ConfigUrl: https://config.uca.cloud.unity3d.com
|
||||
m_DashboardUrl: https://dashboard.unity3d.com
|
||||
m_CNEventUrl: https://cdp.cloud.unity.cn/v1/events
|
||||
m_CNConfigUrl: https://cdp.cloud.unity.cn/config
|
||||
m_TestInitMode: 0
|
||||
CrashReportingSettings:
|
||||
m_EventUrl: https://perf-events.cloud.unity3d.com
|
||||
|
|
|
|||
|
|
@ -1,39 +1,54 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Assembly-CSharp", "Assembly-CSharp.csproj", "{34b3d790-0799-11d2-326f-33d0ff6f6206}"
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Assembly-CSharp", "Assembly-CSharp.csproj", "{90D7B334-9907-D211-326F-33D0FF6F6206}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Boxophobic.Utils.Scripts", "Boxophobic.Utils.Scripts.csproj", "{e23bffcd-3f7f-6434-c8d9-78b1ae3bc3c2}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Boxophobic.Utils.Scripts", "Boxophobic.Utils.Scripts.csproj", "{CDFF3BE2-7F3F-3464-C8D9-78B1AE3BC3C2}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Boxophobic.AtmosphericHeightFog.Runtime", "Boxophobic.AtmosphericHeightFog.Runtime.csproj", "{12bd964c-ebf6-4008-dc94-863a1f7d1d40}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Boxophobic.AtmosphericHeightFog.Runtime", "Boxophobic.AtmosphericHeightFog.Runtime.csproj", "{4C96BD12-F6EB-0840-DC94-863A1F7D1D40}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AmplifyShaderEditor", "AmplifyShaderEditor.csproj", "{cc0d6819-6d6e-7745-34a0-666ccea436db}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AmplifyShaderEditor", "AmplifyShaderEditor.csproj", "{19680DCC-6E6D-4577-34A0-666CCEA436DB}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Boxophobic.AtmosphericHeightFog.Editor", "Boxophobic.AtmosphericHeightFog.Editor.csproj", "{c3b5b72f-5083-1c5d-9f5a-f691307d3efb}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Boxophobic.AtmosphericHeightFog.Editor", "Boxophobic.AtmosphericHeightFog.Editor.csproj", "{2FB7B5C3-8350-5D1C-9F5A-F691307D3EFB}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Boxophobic.Utils.Editor", "Boxophobic.Utils.Editor.csproj", "{7d7f23ee-d234-aed9-0263-133c3f95283c}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Boxophobic.Utils.Editor", "Boxophobic.Utils.Editor.csproj", "{EE237F7D-34D2-D9AE-0263-133C3F95283C}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Assembly-CSharp-Editor", "Assembly-CSharp-Editor.csproj", "{00ffad50-a18b-1355-3a1b-93449eb2679c}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Assembly-CSharp-Editor", "Assembly-CSharp-Editor.csproj", "{50ADFF00-8BA1-5513-3A1B-93449EB2679C}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{34b3d790-0799-11d2-326f-33d0ff6f6206}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{34b3d790-0799-11d2-326f-33d0ff6f6206}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{e23bffcd-3f7f-6434-c8d9-78b1ae3bc3c2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{e23bffcd-3f7f-6434-c8d9-78b1ae3bc3c2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{12bd964c-ebf6-4008-dc94-863a1f7d1d40}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{12bd964c-ebf6-4008-dc94-863a1f7d1d40}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{cc0d6819-6d6e-7745-34a0-666ccea436db}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{cc0d6819-6d6e-7745-34a0-666ccea436db}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{c3b5b72f-5083-1c5d-9f5a-f691307d3efb}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{c3b5b72f-5083-1c5d-9f5a-f691307d3efb}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{7d7f23ee-d234-aed9-0263-133c3f95283c}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{7d7f23ee-d234-aed9-0263-133c3f95283c}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{00ffad50-a18b-1355-3a1b-93449eb2679c}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{00ffad50-a18b-1355-3a1b-93449eb2679c}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{90D7B334-9907-D211-326F-33D0FF6F6206}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{90D7B334-9907-D211-326F-33D0FF6F6206}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{90D7B334-9907-D211-326F-33D0FF6F6206}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{90D7B334-9907-D211-326F-33D0FF6F6206}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{CDFF3BE2-7F3F-3464-C8D9-78B1AE3BC3C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{CDFF3BE2-7F3F-3464-C8D9-78B1AE3BC3C2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{CDFF3BE2-7F3F-3464-C8D9-78B1AE3BC3C2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{CDFF3BE2-7F3F-3464-C8D9-78B1AE3BC3C2}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{4C96BD12-F6EB-0840-DC94-863A1F7D1D40}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{4C96BD12-F6EB-0840-DC94-863A1F7D1D40}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{4C96BD12-F6EB-0840-DC94-863A1F7D1D40}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{4C96BD12-F6EB-0840-DC94-863A1F7D1D40}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{19680DCC-6E6D-4577-34A0-666CCEA436DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{19680DCC-6E6D-4577-34A0-666CCEA436DB}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{19680DCC-6E6D-4577-34A0-666CCEA436DB}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{19680DCC-6E6D-4577-34A0-666CCEA436DB}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{2FB7B5C3-8350-5D1C-9F5A-F691307D3EFB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{2FB7B5C3-8350-5D1C-9F5A-F691307D3EFB}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{2FB7B5C3-8350-5D1C-9F5A-F691307D3EFB}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{2FB7B5C3-8350-5D1C-9F5A-F691307D3EFB}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{EE237F7D-34D2-D9AE-0263-133C3F95283C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{EE237F7D-34D2-D9AE-0263-133C3F95283C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{EE237F7D-34D2-D9AE-0263-133C3F95283C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{EE237F7D-34D2-D9AE-0263-133C3F95283C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{50ADFF00-8BA1-5513-3A1B-93449EB2679C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{50ADFF00-8BA1-5513-3A1B-93449EB2679C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{50ADFF00-8BA1-5513-3A1B-93449EB2679C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{50ADFF00-8BA1-5513-3A1B-93449EB2679C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue