From a3a12084cb9250bbffd0066f0736d2a173632b7e Mon Sep 17 00:00:00 2001 From: taosuqi <2274240467@qq.com> Date: Thu, 9 Apr 2026 18:18:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scenes/Models _tsq.unity | 59 +++++++++++++++++++ .../Scripts/TSQManager/GameMangner_TSQ.cs | 23 +++++++- .../Scripts/UIView/EquipmentSimulationView.cs | 4 ++ 3 files changed, 85 insertions(+), 1 deletion(-) diff --git a/Assets/Scenes/Models _tsq.unity b/Assets/Scenes/Models _tsq.unity index d02b6b0..801d9e8 100644 --- a/Assets/Scenes/Models _tsq.unity +++ b/Assets/Scenes/Models _tsq.unity @@ -1426,6 +1426,56 @@ MonoBehaviour: minIntensity: 0.2 maxIntensity: 0.8 hoverDelay: 1.5 +--- !u!1 &356366128 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 356366130} + - component: {fileID: 356366129} + m_Layer: 0 + m_Name: "Modbus\u63A7\u5236\u5668" + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &356366129 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 356366128} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 21766cb5ef385fb4ea8a5e28c36c993c, type: 3} + m_Name: + m_EditorClassIdentifier: + portName: COM1 + baudRate: 9600 + deviceList: [] + enableDebug: 1 + commandInterval: 0.1 + deviceStatus: [] +--- !u!4 &356366130 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 356366128} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -0.098803386, y: 1.045672, z: 0.118324734} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 17 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &356808669 stripped GameObject: m_CorrespondingSourceObject: {fileID: 2669374314144407500, guid: 9d5faa837db5bd940bc4f9aee8b423d7, type: 3} @@ -1815,6 +1865,7 @@ MonoBehaviour: m_EditorClassIdentifier: firstStep: 4 secondStep: 10 + currentStep: 0 currentState: 0 --- !u!114 &456633870 MonoBehaviour: @@ -13102,6 +13153,7 @@ MonoBehaviour: m_EditorClassIdentifier: firstStep: 1 secondStep: 11 + currentStep: 0 currentState: 0 --- !u!1 &665259325 GameObject: @@ -13317,6 +13369,7 @@ MonoBehaviour: m_EditorClassIdentifier: firstStep: 3 secondStep: 9 + currentStep: 0 currentState: 0 --- !u!114 &713240770 MonoBehaviour: @@ -17902,6 +17955,7 @@ MonoBehaviour: m_EditorClassIdentifier: firstStep: 7 secondStep: 8 + currentStep: 0 currentState: 0 --- !u!1 &1389000718 stripped GameObject: @@ -19210,6 +19264,7 @@ MonoBehaviour: m_EditorClassIdentifier: firstStep: 6 secondStep: 14 + currentStep: 0 currentState: 0 --- !u!1 &1652472845 GameObject: @@ -19240,6 +19295,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 4f4f174381a8ac54784d6658a70c3461, type: 3} m_Name: m_EditorClassIdentifier: + modbusDeviceController: {fileID: 356366129} FirstPersonController: - {fileID: 2130599168} - {fileID: 1159089850} @@ -19752,6 +19808,7 @@ MonoBehaviour: m_EditorClassIdentifier: firstStep: 5 secondStep: 13 + currentStep: 0 currentState: 0 --- !u!1 &1739010014 stripped GameObject: @@ -21188,6 +21245,7 @@ MonoBehaviour: m_EditorClassIdentifier: firstStep: 2 secondStep: 12 + currentStep: 0 currentState: 0 --- !u!114 &1992144278 MonoBehaviour: @@ -21627,6 +21685,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: a65b54357a3caa44b954de966112305d, type: 3} m_Name: m_EditorClassIdentifier: + currentEquipment: {fileID: 0} _expectStepIndex: 0 --- !u!1 &2143385980 GameObject: diff --git a/Assets/Zion/Scripts/TSQManager/GameMangner_TSQ.cs b/Assets/Zion/Scripts/TSQManager/GameMangner_TSQ.cs index 6f81b38..fda94ce 100644 --- a/Assets/Zion/Scripts/TSQManager/GameMangner_TSQ.cs +++ b/Assets/Zion/Scripts/TSQManager/GameMangner_TSQ.cs @@ -5,7 +5,9 @@ using UnityEngine; public class GameMangner_TSQ : MonoBehaviour { public static GameMangner_TSQ instance; - + + public ModbusDeviceController modbusDeviceController; + /// /// 三个场景中第一人称 /// @@ -27,4 +29,23 @@ public class GameMangner_TSQ : MonoBehaviour { Init(); } + + public void bengStartOrStop(bool ison) + { + modbusDeviceController.ControlRedPipe(ison); + modbusDeviceController.ControlGreenPipe(ison); + modbusDeviceController.ControlBluePipe(ison); + modbusDeviceController.ControlTank(ison); + modbusDeviceController.ControlLighting(ison); + } + public void FengJiStartOrStop(bool ison) + { + modbusDeviceController.ControlAirCompressor(ison); + modbusDeviceController.ControlCabinetLight(ison); + modbusDeviceController.ControlRedPipeFlow(ison); + modbusDeviceController.ControlTankUp(ison); + modbusDeviceController.ControlBluePipeFlow(ison); + modbusDeviceController.ControlSecondTankLight(ison); + modbusDeviceController.ControlSecondTurbine(ison); + } } diff --git a/Assets/Zion/Scripts/UIView/EquipmentSimulationView.cs b/Assets/Zion/Scripts/UIView/EquipmentSimulationView.cs index 6bf5dba..c7f64d2 100644 --- a/Assets/Zion/Scripts/UIView/EquipmentSimulationView.cs +++ b/Assets/Zion/Scripts/UIView/EquipmentSimulationView.cs @@ -611,6 +611,7 @@ public class EquipmentSimulationView : UIView variables.Get