diff --git a/U3D_DrivingSystem/Assets/Scenes/main_.unity b/U3D_DrivingSystem/Assets/Scenes/main_.unity index 95a6e67e..bb78b705 100644 --- a/U3D_DrivingSystem/Assets/Scenes/main_.unity +++ b/U3D_DrivingSystem/Assets/Scenes/main_.unity @@ -120832,7 +120832,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!4 &1150478578 Transform: m_ObjectHideFlags: 0 @@ -132595,7 +132595,7 @@ MonoBehaviour: currentGear: 1 gearSpeeds: - 0 - - 20 + - 5 - 40 - 60 xx: 0 diff --git a/U3D_DrivingSystem/Assets/Scenes/menu.unity b/U3D_DrivingSystem/Assets/Scenes/menu.unity index 1514e4c4..874b9fd6 100644 --- a/U3D_DrivingSystem/Assets/Scenes/menu.unity +++ b/U3D_DrivingSystem/Assets/Scenes/menu.unity @@ -358,7 +358,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!224 &76095179 RectTransform: m_ObjectHideFlags: 0 @@ -973,7 +973,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!224 &570311457 RectTransform: m_ObjectHideFlags: 0 @@ -1106,7 +1106,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!224 &574599288 RectTransform: m_ObjectHideFlags: 0 @@ -1509,7 +1509,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!224 &748011624 RectTransform: m_ObjectHideFlags: 0 @@ -1642,7 +1642,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!224 &867050206 RectTransform: m_ObjectHideFlags: 0 @@ -4057,7 +4057,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!224 &1952163225 RectTransform: m_ObjectHideFlags: 0 diff --git a/U3D_DrivingSystem/Assets/Script/CarGearControl.cs b/U3D_DrivingSystem/Assets/Script/CarGearControl.cs index b6c5d134..23cb08d8 100644 --- a/U3D_DrivingSystem/Assets/Script/CarGearControl.cs +++ b/U3D_DrivingSystem/Assets/Script/CarGearControl.cs @@ -24,8 +24,8 @@ namespace Script private CarStatusData carData; - float minValue = -300f; // 范围的最小值 - float maxValue = 300; // 范围的最大值 + float minValue = -900f; // 范围的最小值 + float maxValue = 900; // 范围的最大值 public CarInfoManager carInfoManager; @@ -64,13 +64,14 @@ namespace Script { carData = ModbusTcpClient.modbusTcpClient.modbusQueue.Dequeue(); + Debug.Log(vehicleController.steerInput); //方向盘 vehicleController.steerInput = NormalizeValue(carData.SteeringWheelAngle, minValue, maxValue); //手刹 // vehicleController.throttleInput = carData.HandbrakeStatus == 0 ? 1 : 0; //挡位 00空挡,1前进档,2倒挡,3为P档 //当钥匙为点火状态,才能启动车 - if (carData.IgnitionSwitch == 2) + if (carData.IgnitionSwitch == 1) { switch (carData.GearPosition) { diff --git a/U3D_DrivingSystem/Assets/Script/Manaegr/MenuManager.cs b/U3D_DrivingSystem/Assets/Script/Manaegr/MenuManager.cs index 6d0b8922..aaead507 100644 --- a/U3D_DrivingSystem/Assets/Script/Manaegr/MenuManager.cs +++ b/U3D_DrivingSystem/Assets/Script/Manaegr/MenuManager.cs @@ -26,18 +26,15 @@ public class MenuManager : MonoBehaviour private void Awake() { instance = this; - } private void Start() { - GetComponent().buttons = uiGames[currentStep].GetComponentsInChildren