From 45d5456a81c27e2f3556a3e9b117455d6deed773 Mon Sep 17 00:00:00 2001 From: SnowShow Date: Fri, 9 May 2025 15:30:23 +0800 Subject: [PATCH] =?UTF-8?q?=E9=83=A8=E5=88=86=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Resources/So/Shelf/shelfConfig_1.asset | 2 + .../Resources/So/ShelfMachineBehaviour.asset | 6 +- .../model/prefab/原材料立库 Variant.prefab | 23 +++++-- Assets/GameLogic/Game/Core/Actor/ActorMgr.cs | 63 ++++++++++--------- .../GameLogic/Game/Core/Actor/ShelfActor.cs | 4 +- .../Game/Core/Actor/ShelfMachineToolActor.cs | 8 +-- .../Component/ShelfNetListenerComponent.cs | 55 ++++++++++++++++ .../ShelfNetListenerComponent.cs.meta | 2 + Assets/GameLogic/Game/Utility/DataUtility.cs | 1 + .../Game/Utility/SO/So_ShelfConfig.cs | 4 ++ .../Game/Utility/StackerDeviceDataUtility.cs | 20 ++++++ .../Utility/StackerDeviceDataUtility.cs.meta | 3 + Assets/GameLogic/Origin/data/StackerData.cs | 48 +++++++++++++- Assets/Scenes/main.unity | 41 ++++++++++-- 14 files changed, 229 insertions(+), 51 deletions(-) create mode 100644 Assets/GameLogic/Game/Core/Component/ShelfNetListenerComponent.cs create mode 100644 Assets/GameLogic/Game/Core/Component/ShelfNetListenerComponent.cs.meta create mode 100644 Assets/GameLogic/Game/Utility/StackerDeviceDataUtility.cs create mode 100644 Assets/GameLogic/Game/Utility/StackerDeviceDataUtility.cs.meta diff --git a/Assets/AssetRaw/Resources/So/Shelf/shelfConfig_1.asset b/Assets/AssetRaw/Resources/So/Shelf/shelfConfig_1.asset index 6b20e33..af08c4a 100644 --- a/Assets/AssetRaw/Resources/So/Shelf/shelfConfig_1.asset +++ b/Assets/AssetRaw/Resources/So/Shelf/shelfConfig_1.asset @@ -110,4 +110,6 @@ MonoBehaviour: - Name: Entry: 8 Data: + deviceCode: DDJ01 + deviceType: STACKER groups: 010000000300000004000000 diff --git a/Assets/AssetRaw/Resources/So/ShelfMachineBehaviour.asset b/Assets/AssetRaw/Resources/So/ShelfMachineBehaviour.asset index 01840f1..9427c97 100644 --- a/Assets/AssetRaw/Resources/So/ShelfMachineBehaviour.asset +++ b/Assets/AssetRaw/Resources/So/ShelfMachineBehaviour.asset @@ -12,13 +12,13 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 7a686a47eee2fa44cb0a34b5d86e4d5e, type: 3} m_Name: ShelfMachineBehaviour m_EditorClassIdentifier: - _serializedGraph: '{"type":"NodeCanvas.BehaviourTrees.BehaviourTree","nodes":[{"selectionMode":1,"intCase":{},"enumCase":{"_type":"System.Enum","_name":"shelfToolActionType","_targetVariableID":"046106d6-ba37-46e3-8cc2-cbaac14b6e2b"},"_position":{"x":903.6849,"y":-201.4608},"$type":"NodeCanvas.BehaviourTrees.Switch","$id":"0"},{"_position":{"x":-826.605,"y":207.1316},"$type":"NodeCanvas.BehaviourTrees.ActionNode","$id":"1"},{"_position":{"x":36.05078,"y":209.6188},"$type":"NodeCanvas.BehaviourTrees.Sequencer","$id":"2"},{"_action":{"method":{"_baseInfo":"GameLogic.ShelfMachineToolActor|LoadStart|System.Void","_paramsInfo":""},"parameters":[],"returnValue":{},"$type":"NodeCanvas.Tasks.Actions.ExecuteFunction_Multiplatform"},"_position":{"x":-698.1113,"y":411.6769},"$type":"NodeCanvas.BehaviourTrees.ActionNode","$id":"3"},{"repeaterMode":1,"repeatTimes":{"_value":1},"_position":{"x":-433.5931,"y":329.1874},"$type":"NodeCanvas.BehaviourTrees.Repeater","$id":"4"},{"_condition":{"method":{"_baseInfo":"GameLogic.ShelfMachineToolActor|EnableLoadStartPositionComplete|System.Boolean","_paramsInfo":""},"parameters":[],"checkValue":{"_type":"System.Boolean","_value":{"$content":true,"$type":"System.Boolean"}},"$type":"NodeCanvas.Tasks.Conditions.CheckFunction_Multiplatform"},"_position":{"x":-542.9797,"y":415.3228},"$type":"NodeCanvas.BehaviourTrees.ConditionNode","$id":"5"},{"repeaterMode":1,"repeatTimes":{"_value":1},"_position":{"x":-131.0505,"y":322.1024},"$type":"NodeCanvas.BehaviourTrees.Repeater","$id":"6"},{"_condition":{"method":{"_baseInfo":"GameLogic.ShelfMachineToolActor|EnableLoadPickUpAnimation|System.Boolean","_paramsInfo":""},"parameters":[],"checkValue":{"_type":"System.Boolean","_value":{"$content":true,"$type":"System.Boolean"}},"$type":"NodeCanvas.Tasks.Conditions.CheckFunction_Multiplatform"},"_position":{"x":-219.3914,"y":414.4665},"$type":"NodeCanvas.BehaviourTrees.ConditionNode","$id":"7"},{"repeaterMode":1,"repeatTimes":{"_value":1},"_position":{"x":164.7108,"y":318.844},"$type":"NodeCanvas.BehaviourTrees.Repeater","$id":"8"},{"_condition":{"method":{"_baseInfo":"GameLogic.ShelfMachineToolActor|EnableStartLoadToShelfPosition|System.Boolean","_paramsInfo":""},"parameters":[],"checkValue":{"_type":"System.Boolean","_value":{"$content":true,"$type":"System.Boolean"}},"$type":"NodeCanvas.Tasks.Conditions.CheckFunction_Multiplatform"},"_position":{"x":62.0999,"y":415.2059},"$type":"NodeCanvas.BehaviourTrees.ConditionNode","$id":"9"},{"repeaterMode":1,"repeatTimes":{"_value":1},"_position":{"x":481.5369,"y":322.2792},"$type":"NodeCanvas.BehaviourTrees.Repeater","$id":"10"},{"_condition":{"method":{"_baseInfo":"GameLogic.ShelfMachineToolActor|EnableLoadPutDownAnimation|System.Boolean","_paramsInfo":""},"parameters":[],"checkValue":{"_type":"System.Boolean","_value":{"$content":true,"$type":"System.Boolean"}},"$type":"NodeCanvas.Tasks.Conditions.CheckFunction_Multiplatform"},"_position":{"x":380.4397,"y":414.6433},"$type":"NodeCanvas.BehaviourTrees.ConditionNode","$id":"11"},{"_action":{"method":{"_baseInfo":"GameLogic.ShelfMachineToolActor|LoadEnd|System.Void","_paramsInfo":""},"parameters":[],"returnValue":{},"$type":"NodeCanvas.Tasks.Actions.ExecuteFunction_Multiplatform"},"_position":{"x":724.7833,"y":415.1558},"$type":"NodeCanvas.BehaviourTrees.ActionNode","$id":"12"},{"_position":{"x":1593.473,"y":212.9113},"$type":"NodeCanvas.BehaviourTrees.Sequencer","$id":"13"},{"_action":{"method":{"_baseInfo":"GameLogic.ShelfMachineToolActor|UnLoadStart|System.Void","_paramsInfo":""},"parameters":[],"returnValue":{},"$type":"NodeCanvas.Tasks.Actions.ExecuteFunction_Multiplatform"},"_position":{"x":859.3107,"y":414.9694},"$type":"NodeCanvas.BehaviourTrees.ActionNode","$id":"14"},{"repeaterMode":1,"repeatTimes":{"_value":1},"_position":{"x":1123.829,"y":332.4799},"$type":"NodeCanvas.BehaviourTrees.Repeater","$id":"15"},{"_condition":{"method":{"_baseInfo":"GameLogic.ShelfMachineToolActor|EnableUnLoadArriveContainerPosition|System.Boolean","_paramsInfo":""},"parameters":[],"checkValue":{"_type":"System.Boolean","_value":{"$content":true,"$type":"System.Boolean"}},"$type":"NodeCanvas.Tasks.Conditions.CheckFunction_Multiplatform"},"_position":{"x":998.0799,"y":415.5513},"$type":"NodeCanvas.BehaviourTrees.ConditionNode","$id":"16"},{"repeaterMode":1,"repeatTimes":{"_value":1},"_position":{"x":1426.372,"y":325.3948},"$type":"NodeCanvas.BehaviourTrees.Repeater","$id":"17"},{"_condition":{"method":{"_baseInfo":"GameLogic.ShelfMachineToolActor|EnableLoadPickUpAnimation|System.Boolean","_paramsInfo":""},"parameters":[],"checkValue":{"_type":"System.Boolean","_value":{"$content":true,"$type":"System.Boolean"}},"$type":"NodeCanvas.Tasks.Conditions.CheckFunction_Multiplatform"},"_position":{"x":1338.031,"y":417.7589},"$type":"NodeCanvas.BehaviourTrees.ConditionNode","$id":"18"},{"repeaterMode":1,"repeatTimes":{"_value":1},"_position":{"x":1762.26,"y":333.7991},"$type":"NodeCanvas.BehaviourTrees.Repeater","$id":"19"},{"_condition":{"method":{"_baseInfo":"GameLogic.ShelfMachineToolActor|EnableLoadStartPositionComplete|System.Boolean","_paramsInfo":""},"parameters":[],"checkValue":{"_type":"System.Boolean","_value":{"$content":true,"$type":"System.Boolean"}},"$type":"NodeCanvas.Tasks.Conditions.CheckFunction_Multiplatform"},"_position":{"x":1652.873,"y":419.9345},"$type":"NodeCanvas.BehaviourTrees.ConditionNode","$id":"20"},{"repeaterMode":1,"repeatTimes":{"_value":1},"_position":{"x":2111.588,"y":335.055},"$type":"NodeCanvas.BehaviourTrees.Repeater","$id":"21"},{"_condition":{"method":{"_baseInfo":"GameLogic.ShelfMachineToolActor|EnableLoadPutDownAnimation|System.Boolean","_paramsInfo":""},"parameters":[],"checkValue":{"_type":"System.Boolean","_value":{"$content":true,"$type":"System.Boolean"}},"$type":"NodeCanvas.Tasks.Conditions.CheckFunction_Multiplatform"},"_position":{"x":2010.491,"y":427.4191},"$type":"NodeCanvas.BehaviourTrees.ConditionNode","$id":"22"},{"_action":{"method":{"_baseInfo":"GameLogic.ShelfMachineToolActor|LoadEnd|System.Void","_paramsInfo":""},"parameters":[],"returnValue":{},"$type":"NodeCanvas.Tasks.Actions.ExecuteFunction_Multiplatform"},"_position":{"x":2770.014,"y":362.1248},"$type":"NodeCanvas.BehaviourTrees.ActionNode"},{"repeaterMode":1,"repeatTimes":{"_value":1},"_position":{"x":2580.881,"y":250.8126},"$type":"NodeCanvas.BehaviourTrees.Repeater","$id":"24"},{"_condition":{"method":{"_baseInfo":"GameLogic.ShelfMachineToolActor|EnableStartLoadToShelfPosition|System.Boolean","_paramsInfo":""},"parameters":[],"checkValue":{"_type":"System.Boolean","_value":{"$content":true,"$type":"System.Boolean"}},"$type":"NodeCanvas.Tasks.Conditions.CheckFunction_Multiplatform"},"_position":{"x":2402.864,"y":349.0137},"$type":"NodeCanvas.BehaviourTrees.ConditionNode","$id":"25"}],"connections":[{"_sourceNode":{"$ref":"0"},"_targetNode":{"$ref":"1"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"0"},"_targetNode":{"$ref":"2"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"0"},"_targetNode":{"$ref":"13"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"2"},"_targetNode":{"$ref":"3"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"2"},"_targetNode":{"$ref":"4"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"2"},"_targetNode":{"$ref":"6"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"2"},"_targetNode":{"$ref":"8"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"2"},"_targetNode":{"$ref":"10"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"2"},"_targetNode":{"$ref":"12"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"4"},"_targetNode":{"$ref":"5"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"6"},"_targetNode":{"$ref":"7"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"8"},"_targetNode":{"$ref":"9"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"10"},"_targetNode":{"$ref":"11"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"13"},"_targetNode":{"$ref":"14"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"13"},"_targetNode":{"$ref":"15"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"13"},"_targetNode":{"$ref":"17"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"13"},"_targetNode":{"$ref":"19"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"13"},"_targetNode":{"$ref":"21"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"15"},"_targetNode":{"$ref":"16"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"17"},"_targetNode":{"$ref":"18"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"19"},"_targetNode":{"$ref":"20"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"21"},"_targetNode":{"$ref":"22"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"24"},"_targetNode":{"$ref":"25"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"}],"canvasGroups":[],"localBlackboard":{"_variables":{}},"derivedData":{"$type":"NodeCanvas.BehaviourTrees.BehaviourTree+DerivedSerializationData"}}' + _serializedGraph: '{"type":"NodeCanvas.BehaviourTrees.BehaviourTree","nodes":[{"selectionMode":1,"intCase":{},"enumCase":{"_type":"System.Enum","_name":"shelfToolActionType","_targetVariableID":"046106d6-ba37-46e3-8cc2-cbaac14b6e2b"},"_position":{"x":903.6849,"y":-201.4608},"$type":"NodeCanvas.BehaviourTrees.Switch","$id":"0"},{"_position":{"x":-826.605,"y":207.1316},"$type":"NodeCanvas.BehaviourTrees.ActionNode","$id":"1"},{"_position":{"x":36.05078,"y":209.6188},"$type":"NodeCanvas.BehaviourTrees.Sequencer","$id":"2"},{"_action":{"method":{"_baseInfo":"GameLogic.ShelfMachineToolActor|LoadStart|System.Void","_paramsInfo":""},"parameters":[],"returnValue":{},"$type":"NodeCanvas.Tasks.Actions.ExecuteFunction_Multiplatform"},"_position":{"x":-1177.889,"y":294.6636},"$type":"NodeCanvas.BehaviourTrees.ActionNode","$id":"3"},{"repeaterMode":1,"repeatTimes":{"_value":1},"_position":{"x":-539.1978,"y":324.3872},"$type":"NodeCanvas.BehaviourTrees.Repeater","$id":"4"},{"_condition":{"method":{"_baseInfo":"GameLogic.ShelfMachineToolActor|EnableArriveStationPositionComplete|System.Boolean","_paramsInfo":"System.Single"},"parameters":[{"_type":"System.Single","_name":"_loadPickUpOffest","_targetVariableID":"97896196-eb4a-41b5-aad8-71e9be09393f"}],"checkValue":{"_type":"System.Boolean","_value":{"$content":true,"$type":"System.Boolean"}},"$type":"NodeCanvas.Tasks.Conditions.CheckFunction_Multiplatform"},"_position":{"x":-847.5665,"y":414.8893},"$type":"NodeCanvas.BehaviourTrees.ConditionNode","$id":"5"},{"repeaterMode":1,"repeatTimes":{"_value":1},"_position":{"x":-268.9386,"y":321.008},"$type":"NodeCanvas.BehaviourTrees.Repeater","$id":"6"},{"_condition":{"method":{"_baseInfo":"GameLogic.ShelfMachineToolActor|EnableLoadPickUpAnimation|System.Boolean","_paramsInfo":""},"parameters":[],"checkValue":{"_type":"System.Boolean","_value":{"$content":true,"$type":"System.Boolean"}},"$type":"NodeCanvas.Tasks.Conditions.CheckFunction_Multiplatform"},"_position":{"x":-357.2795,"y":413.3721},"$type":"NodeCanvas.BehaviourTrees.ConditionNode","$id":"7"},{"repeaterMode":1,"repeatTimes":{"_value":1},"_position":{"x":89.00835,"y":315.403},"$type":"NodeCanvas.BehaviourTrees.Repeater","$id":"8"},{"_condition":{"method":{"_baseInfo":"GameLogic.ShelfMachineToolActor|EnableArriveContainerPosition|System.Boolean","_paramsInfo":"System.Single"},"parameters":[{"_type":"System.Single","_name":"_loadPutDownOffest","_targetVariableID":"2bac7793-b579-4ca3-9d5f-24570d649411"}],"checkValue":{"_type":"System.Boolean","_value":{"$content":true,"$type":"System.Boolean"}},"$type":"NodeCanvas.Tasks.Conditions.CheckFunction_Multiplatform"},"_position":{"x":-42.93225,"y":413.0981},"$type":"NodeCanvas.BehaviourTrees.ConditionNode","$id":"9"},{"repeaterMode":1,"repeatTimes":{"_value":1},"_position":{"x":481.5369,"y":322.2792},"$type":"NodeCanvas.BehaviourTrees.Repeater","$id":"10"},{"_condition":{"method":{"_baseInfo":"GameLogic.ShelfMachineToolActor|EnableLoadPutDownAnimation|System.Boolean","_paramsInfo":""},"parameters":[],"checkValue":{"_type":"System.Boolean","_value":{"$content":true,"$type":"System.Boolean"}},"$type":"NodeCanvas.Tasks.Conditions.CheckFunction_Multiplatform"},"_position":{"x":403.4397,"y":413.6433},"$type":"NodeCanvas.BehaviourTrees.ConditionNode","$id":"11"},{"_action":{"method":{"_baseInfo":"GameLogic.ShelfMachineToolActor|LoadEnd|System.Void","_paramsInfo":""},"parameters":[],"returnValue":{},"$type":"NodeCanvas.Tasks.Actions.ExecuteFunction_Multiplatform"},"_position":{"x":724.7833,"y":415.1558},"$type":"NodeCanvas.BehaviourTrees.ActionNode","$id":"12"},{"_position":{"x":1593.473,"y":212.9113},"$type":"NodeCanvas.BehaviourTrees.Sequencer","$id":"13"},{"_action":{"method":{"_baseInfo":"GameLogic.ShelfMachineToolActor|UnLoadStart|System.Void","_paramsInfo":""},"parameters":[],"returnValue":{},"$type":"NodeCanvas.Tasks.Actions.ExecuteFunction_Multiplatform"},"_position":{"x":859.3107,"y":414.9694},"$type":"NodeCanvas.BehaviourTrees.ActionNode","$id":"14"},{"repeaterMode":1,"repeatTimes":{"_value":1},"_position":{"x":1123.829,"y":332.4799},"$type":"NodeCanvas.BehaviourTrees.Repeater","$id":"15"},{"_condition":{"method":{"_baseInfo":"GameLogic.ShelfMachineToolActor|EnableArriveContainerPosition|System.Boolean","_paramsInfo":"System.Single"},"parameters":[{"_type":"System.Single","_name":"_UnloadPickUpOffest","_targetVariableID":"6bda5aa3-4a01-408a-8398-fb874e6b6a55"}],"checkValue":{"_type":"System.Boolean","_value":{"$content":true,"$type":"System.Boolean"}},"$type":"NodeCanvas.Tasks.Conditions.CheckFunction_Multiplatform"},"_position":{"x":970.0672,"y":423.555},"$type":"NodeCanvas.BehaviourTrees.ConditionNode","$id":"16"},{"repeaterMode":1,"repeatTimes":{"_value":1},"_position":{"x":1426.372,"y":325.3948},"$type":"NodeCanvas.BehaviourTrees.Repeater","$id":"17"},{"_condition":{"method":{"_baseInfo":"GameLogic.ShelfMachineToolActor|EnableLoadPickUpAnimation|System.Boolean","_paramsInfo":""},"parameters":[],"checkValue":{"_type":"System.Boolean","_value":{"$content":true,"$type":"System.Boolean"}},"$type":"NodeCanvas.Tasks.Conditions.CheckFunction_Multiplatform"},"_position":{"x":1372.485,"y":418.9894},"$type":"NodeCanvas.BehaviourTrees.ConditionNode","$id":"18"},{"repeaterMode":1,"repeatTimes":{"_value":1},"_position":{"x":1762.26,"y":333.7991},"$type":"NodeCanvas.BehaviourTrees.Repeater","$id":"19"},{"_condition":{"method":{"_baseInfo":"GameLogic.ShelfMachineToolActor|EnableArriveStationPositionComplete|System.Boolean","_paramsInfo":"System.Single"},"parameters":[{"_type":"System.Single","_name":"_UnloadPutDownOffest","_targetVariableID":"73b620e7-05e7-47b4-83dc-e00c8c4c29d5"}],"checkValue":{"_type":"System.Boolean","_value":{"$content":true,"$type":"System.Boolean"}},"$type":"NodeCanvas.Tasks.Conditions.CheckFunction_Multiplatform"},"_position":{"x":1652.873,"y":419.9345},"$type":"NodeCanvas.BehaviourTrees.ConditionNode","$id":"20"},{"repeaterMode":1,"repeatTimes":{"_value":1},"_position":{"x":2271.552,"y":314.1367},"$type":"NodeCanvas.BehaviourTrees.Repeater","$id":"21"},{"_condition":{"method":{"_baseInfo":"GameLogic.ShelfMachineToolActor|EnableLoadPutDownAnimation|System.Boolean","_paramsInfo":""},"parameters":[],"checkValue":{"_type":"System.Boolean","_value":{"$content":true,"$type":"System.Boolean"}},"$type":"NodeCanvas.Tasks.Conditions.CheckFunction_Multiplatform"},"_position":{"x":2171.685,"y":422.4972},"$type":"NodeCanvas.BehaviourTrees.ConditionNode","$id":"22"},{"_action":{"method":{"_baseInfo":"GameLogic.ShelfMachineToolActor|UnLoadEnd|System.Void","_paramsInfo":""},"parameters":[],"returnValue":{},"$type":"NodeCanvas.Tasks.Actions.ExecuteFunction_Multiplatform"},"_position":{"x":2539.228,"y":419.1557},"$type":"NodeCanvas.BehaviourTrees.ActionNode","$id":"23"}],"connections":[{"_sourceNode":{"$ref":"0"},"_targetNode":{"$ref":"1"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"0"},"_targetNode":{"$ref":"2"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"0"},"_targetNode":{"$ref":"13"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"2"},"_targetNode":{"$ref":"3"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"2"},"_targetNode":{"$ref":"4"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"2"},"_targetNode":{"$ref":"6"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"2"},"_targetNode":{"$ref":"8"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"2"},"_targetNode":{"$ref":"10"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"2"},"_targetNode":{"$ref":"12"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"4"},"_targetNode":{"$ref":"5"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"6"},"_targetNode":{"$ref":"7"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"8"},"_targetNode":{"$ref":"9"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"10"},"_targetNode":{"$ref":"11"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"13"},"_targetNode":{"$ref":"14"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"13"},"_targetNode":{"$ref":"15"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"13"},"_targetNode":{"$ref":"17"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"13"},"_targetNode":{"$ref":"19"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"13"},"_targetNode":{"$ref":"21"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"13"},"_targetNode":{"$ref":"23"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"15"},"_targetNode":{"$ref":"16"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"17"},"_targetNode":{"$ref":"18"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"19"},"_targetNode":{"$ref":"20"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"21"},"_targetNode":{"$ref":"22"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"}],"canvasGroups":[],"localBlackboard":{"_variables":{}},"derivedData":{"$type":"NodeCanvas.BehaviourTrees.BehaviourTree+DerivedSerializationData"}}' _objectReferences: [] _graphSource: _version: 3.32 _category: _comments: - _translation: {x: -1290, y: -14} - _zoomFactor: 0.8357812 + _translation: {x: -95.31054, y: 201.18945} + _zoomFactor: 0.4669012 _haltSerialization: 0 _externalSerializationFile: {fileID: 0} diff --git a/Assets/AssetRaw/model/prefab/原材料立库 Variant.prefab b/Assets/AssetRaw/model/prefab/原材料立库 Variant.prefab index 60c9dd1..f70c98d 100644 --- a/Assets/AssetRaw/model/prefab/原材料立库 Variant.prefab +++ b/Assets/AssetRaw/model/prefab/原材料立库 Variant.prefab @@ -148570,10 +148570,10 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: _id: 0 - _actionType: 0 - _moveSpeed: 5 - _moveSeconds: 0 - _shelfconfig: {fileID: 0} + _loadPickUpOffest: 0.2 + _loadPutDownOffest: 0.2 + _UnloadPickUpOffest: 0.2 + _UnloadPutDownOffest: 0.2 --- !u!114 &7671920962013540943 MonoBehaviour: m_ObjectHideFlags: 0 @@ -150165,6 +150165,9 @@ PrefabInstance: - targetCorrespondingSourceObject: {fileID: 919132149155446097, guid: a8fcb4c823a21fb40ba82978968e1c21, type: 3} insertIndex: -1 addedObject: {fileID: 6092765321511910216} + - targetCorrespondingSourceObject: {fileID: 919132149155446097, guid: a8fcb4c823a21fb40ba82978968e1c21, type: 3} + insertIndex: -1 + addedObject: {fileID: 3084122142851895118} m_SourcePrefab: {fileID: 100100000, guid: a8fcb4c823a21fb40ba82978968e1c21, type: 3} --- !u!4 &4816128638542576846 stripped Transform: @@ -150190,6 +150193,18 @@ MonoBehaviour: m_EditorClassIdentifier: _id: 0 _shelfConfig: {fileID: 0} +--- !u!114 &3084122142851895118 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5304540892573083252} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 20e0d00e57698f84887368e168629083, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1001 &5956433743207170642 PrefabInstance: m_ObjectHideFlags: 0 diff --git a/Assets/GameLogic/Game/Core/Actor/ActorMgr.cs b/Assets/GameLogic/Game/Core/Actor/ActorMgr.cs index 156e79f..27e8edf 100644 --- a/Assets/GameLogic/Game/Core/Actor/ActorMgr.cs +++ b/Assets/GameLogic/Game/Core/Actor/ActorMgr.cs @@ -39,38 +39,39 @@ namespace GameLogic protected override void OnUpdate() { base.OnUpdate(); - if (Input.GetKeyDown(KeyCode.R)) - { - try - { - Debug.LogWarning("取货03-01-02"); - var co = _containerInfos["03-01-02"]; - co.shelf.LoadTest(co); - } - catch (Exception e) - { - Debug.LogWarning("货物不存在"); - throw; - } - - } - - if (Input.GetKeyDown(KeyCode.T)) - { - try - { - Debug.LogWarning("取货03-01-02"); - var co = _containerInfos["03-01-02"]; - co.shelf.UnLoadTest(co); - } - catch (Exception e) - { - Debug.LogWarning("货物不存在"); - throw; - } - - } + // if (Input.GetKeyDown(KeyCode.R)) + // { + // try + // { + // Debug.LogWarning("取货03-01-02"); + // var co = _containerInfos["03-01-02"]; + // //co.shelf.LoadTest(co,gameObject); + // } + // catch (Exception e) + // { + // Debug.LogWarning("货物不存在"); + // throw; + // } + // + // } + // + // if (Input.GetKeyDown(KeyCode.T)) + // { + // try + // { + // Debug.LogWarning("取货03-01-02"); + // var co = _containerInfos["03-01-02"]; + // co.shelf.UnLoadTest(co); + // } + // catch (Exception e) + // { + // Debug.LogWarning("货物不存在"); + // throw; + // } + // + // } } + /// diff --git a/Assets/GameLogic/Game/Core/Actor/ShelfActor.cs b/Assets/GameLogic/Game/Core/Actor/ShelfActor.cs index 5c7f657..b80fedd 100644 --- a/Assets/GameLogic/Game/Core/Actor/ShelfActor.cs +++ b/Assets/GameLogic/Game/Core/Actor/ShelfActor.cs @@ -44,7 +44,7 @@ namespace GameLogic /// /// 取货 /// - public void LoadContainer(string station,ContainerInfo container) + public void LoadContainer(string station,GameObject container,ContainerInfo coInfo) { } @@ -62,8 +62,10 @@ namespace GameLogic GameObject go = Instantiate(containerPrefab); container.container = go; go.SetTransformNoScale(stationT); + station = stationT; } + _shelfMachineToolActor.Load(station,container,_shelfConfig); } diff --git a/Assets/GameLogic/Game/Core/Actor/ShelfMachineToolActor.cs b/Assets/GameLogic/Game/Core/Actor/ShelfMachineToolActor.cs index a3369ab..85e7b96 100644 --- a/Assets/GameLogic/Game/Core/Actor/ShelfMachineToolActor.cs +++ b/Assets/GameLogic/Game/Core/Actor/ShelfMachineToolActor.cs @@ -44,13 +44,7 @@ namespace GameLogic [ShowInInspector,BoxGroup("Load"),ReadOnly]private bool _isEnablePickUpAnimationComplete = false; [ShowInInspector,BoxGroup("Load"),ReadOnly]private bool _isEnableArriveContainerPositionComplete = false; [ShowInInspector,BoxGroup("Load"),ReadOnly]private bool _isEnablePutDownAnimationComplete = false; - - - [Title("ȡΪ")] - [ShowInInspector,BoxGroup("UnLoad"),ReadOnly]private bool _isEnableUnLoadArriveContainerPositionComplete = false; - [ShowInInspector,BoxGroup("UnLoad"),ReadOnly]private bool _isEnableUnLoadPickUpAnimationComplete = false; - [ShowInInspector,BoxGroup("UnLoad"),ReadOnly]private bool _isEnableUnLoadArriveStationPositionComplete = false; - [ShowInInspector,BoxGroup("UnLoad"),ReadOnly]private bool _isEnableUnLoadPutDownAnimationComplete = false; + protected override void OnLoad() { base.OnLoad(); diff --git a/Assets/GameLogic/Game/Core/Component/ShelfNetListenerComponent.cs b/Assets/GameLogic/Game/Core/Component/ShelfNetListenerComponent.cs new file mode 100644 index 0000000..ed4c11c --- /dev/null +++ b/Assets/GameLogic/Game/Core/Component/ShelfNetListenerComponent.cs @@ -0,0 +1,55 @@ +using System; +using EasyInject.Attributes; +using GameLogic; +using Newtonsoft.Json; +using NUnit.Framework; +using Sirenix.OdinInspector; +using UnityEngine; + + +[GameObjectBean(ENameType.GameObjectName)] +public class ShelfNetListenerComponent : MonoBehaviour,IWcsSocketDataHandle +{ + public Transform Transform { get; } + public DeviceData DeviceData { get; } + public T DynamicData() + { + throw new System.NotImplementedException(); + } + + [ShowInInspector]public string DeviceCode => _deviceCode; + [ShowInInspector]public string DeviceType => _deviceType; + + private string _deviceCode ; + private string _deviceType; + + public event IDevice.DataChangeEvent DataChange; + public event IDevice.DataChangeEvent ErrorMessage; + + [ShowInInspector]public ShelfActor _shelfActor; + + private void Start() + { + _shelfActor = GetComponent(); + _deviceCode = _shelfActor._shelfConfig.deviceCode; + _deviceType = _shelfActor._shelfConfig.deviceType; + } + + public void DataHandle(object data, object other = null) + { + Debug.Log("DataHandle"); + // if (string.IsNullOrEmpty(_deviceCode) || _deviceCode.Length <=0) return; + // //if (! (data is StackerData stackerData)) return; + // // + // var stackerData = JsonConvert.DeserializeObject(JsonConvert.SerializeObject(data)); + // //frontHasGoodsDesc = stackerData.frontForkHasGoods == true ? "ǰл" : "޻"; + // var deviceData = JsonConvert.DeserializeObject(JsonConvert.SerializeObject(other)); + // Debug.Log(StackerDeviceDataUtility.GetPositionInfo(stackerData)); + // if (stackerData.frontForkHasGoods); + // { + // + // } + } + +} + diff --git a/Assets/GameLogic/Game/Core/Component/ShelfNetListenerComponent.cs.meta b/Assets/GameLogic/Game/Core/Component/ShelfNetListenerComponent.cs.meta new file mode 100644 index 0000000..309e266 --- /dev/null +++ b/Assets/GameLogic/Game/Core/Component/ShelfNetListenerComponent.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 20e0d00e57698f84887368e168629083 \ No newline at end of file diff --git a/Assets/GameLogic/Game/Utility/DataUtility.cs b/Assets/GameLogic/Game/Utility/DataUtility.cs index 4ed6e1b..d4b3408 100644 --- a/Assets/GameLogic/Game/Utility/DataUtility.cs +++ b/Assets/GameLogic/Game/Utility/DataUtility.cs @@ -21,6 +21,7 @@ namespace GameLogic var array = data.Split('-'); return int.Parse(array[2]); } + } } diff --git a/Assets/GameLogic/Game/Utility/SO/So_ShelfConfig.cs b/Assets/GameLogic/Game/Utility/SO/So_ShelfConfig.cs index 6e9e07b..53059e7 100644 --- a/Assets/GameLogic/Game/Utility/SO/So_ShelfConfig.cs +++ b/Assets/GameLogic/Game/Utility/SO/So_ShelfConfig.cs @@ -9,6 +9,10 @@ namespace GameLogic [CreateAssetMenu(fileName = "shelfConfig_", menuName = "/ShelfConfig")] public class So_ShelfConfig : SerializedScriptableObject { + + + [LabelText(""), ShowInInspector] public string deviceCode; + [LabelText(""), ShowInInspector] public string deviceType = "STACKER"; [LabelText(""),ShowInInspector] public List groups = new List(); [LabelText(""),ShowInInspector]public Dictionary shelfAnimDatas = new Dictionary(); diff --git a/Assets/GameLogic/Game/Utility/StackerDeviceDataUtility.cs b/Assets/GameLogic/Game/Utility/StackerDeviceDataUtility.cs new file mode 100644 index 0000000..e444af3 --- /dev/null +++ b/Assets/GameLogic/Game/Utility/StackerDeviceDataUtility.cs @@ -0,0 +1,20 @@ +using UnityEngine; + +namespace GameLogic +{ + public static class StackerDeviceDataUtility + { + + /// + /// ȡվλϢ + /// + /// + /// + public static string GetPositionInfo(StackerData data) + { + return $"{data.toRow}-{data.frontColumn}-{data.toLayer}"; + } + + } + +} diff --git a/Assets/GameLogic/Game/Utility/StackerDeviceDataUtility.cs.meta b/Assets/GameLogic/Game/Utility/StackerDeviceDataUtility.cs.meta new file mode 100644 index 0000000..11e59ac --- /dev/null +++ b/Assets/GameLogic/Game/Utility/StackerDeviceDataUtility.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 867844248f7945388f0f41f9c0543888 +timeCreated: 1746773217 \ No newline at end of file diff --git a/Assets/GameLogic/Origin/data/StackerData.cs b/Assets/GameLogic/Origin/data/StackerData.cs index 0076a07..c9c61ac 100644 --- a/Assets/GameLogic/Origin/data/StackerData.cs +++ b/Assets/GameLogic/Origin/data/StackerData.cs @@ -4,20 +4,49 @@ using System; [System.Serializable] public class StackerData { + /// + /// + /// public string frontContainerCode; - public string frontInstructionCode; + + + // /// + // /// + // /// + public string frontInstructionCode; //public string frontFrom; //public bool? frontStatus; + + /// + /// ״̬ + /// public string frontStatusDescription; //public string backContainerCode; //public string backInstructionCode; //public string backTo; //public string backStatusDescription; public int roadway; + + + /// + /// + /// public int frontRow; public int frontColumn; + + /// + /// IJ + /// public int frontLayer; + + /// + /// + /// public int special1; + + /// + /// ź + /// public StackerForkActionEnum frontForkAction; public string frontForkActionDescription; public StackerForkCargoEnum frontForkCargo; @@ -28,6 +57,10 @@ public class StackerData //public string backForkActionDescription; //public string taskType; //public string taskTypeDescription; + + /// + /// лź + /// public Boolean frontForkHasGoods; //public bool? backForkHasGoods; public string strategyCode; @@ -35,8 +68,21 @@ public class StackerData //public string stageTrackLength; //public string realTrackLength; //public string moveDirection; + + + /// + /// ַ + /// public int toRow; + + /// + /// ַ + /// public int toColumn; + + /// + /// ַ + /// public int toLayer; public int toCommand; public string toCommandDescription; diff --git a/Assets/Scenes/main.unity b/Assets/Scenes/main.unity index 1d4f880..f7ebe62 100644 --- a/Assets/Scenes/main.unity +++ b/Assets/Scenes/main.unity @@ -32254,7 +32254,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 0.0006180698} + m_AnchoredPosition: {x: 0, y: -0.00013542175} m_SizeDelta: {x: 0, y: 300} m_Pivot: {x: 0, y: 1} --- !u!114 &478527198 @@ -66764,8 +66764,8 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 963194225} serializedVersion: 2 - m_LocalRotation: {x: 0.06113388, y: -0.9031976, z: 0.13733405, w: 0.40204} - m_LocalPosition: {x: 90.59197, y: 24.513542, z: 24.777458} + m_LocalRotation: {x: -0.059602156, y: -0.8828924, z: 0.116679616, w: -0.45092642} + m_LocalPosition: {x: 21.895561, y: 26.234213, z: 22.103218} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] @@ -90712,7 +90712,7 @@ MonoBehaviour: m_HandleRect: {fileID: 1614015367} m_Direction: 2 m_Value: 0 - m_Size: 0.999477 + m_Size: 1 m_NumberOfSteps: 0 m_OnValueChanged: m_PersistentCalls: @@ -107584,6 +107584,39 @@ PrefabInstance: propertyPath: m_LocalPosition.z value: 18.1555 objectReference: {fileID: 0} + - target: {fileID: 674022236643372559, guid: 7827ccff2c5319541bbaf34e30e83074, type: 3} + propertyPath: _serializedBlackboard + value: '{"_variables":{"shelfToolActionType":{"_propertyPath":"GameLogic.ShelfMachineToolActor._actionType","_name":"shelfToolActionType","_id":"046106d6-ba37-46e3-8cc2-cbaac14b6e2b","$type":"NodeCanvas.Framework.Variable`1[[System.Enum, + mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]"},"_loadPickUpOffest":{"_propertyPath":"GameLogic.ShelfMachineToolActor._loadPickUpOffest","_name":"_loadPickUpOffest","_id":"97896196-eb4a-41b5-aad8-71e9be09393f","$type":"NodeCanvas.Framework.Variable`1[[System.Single, + mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]"},"_loadPutDownOffest":{"_propertyPath":"GameLogic.ShelfMachineToolActor._loadPutDownOffest","_name":"_loadPutDownOffest","_id":"2bac7793-b579-4ca3-9d5f-24570d649411","$type":"NodeCanvas.Framework.Variable`1[[System.Single, + mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]"},"_UnloadPickUpOffest":{"_propertyPath":"GameLogic.ShelfMachineToolActor._UnloadPickUpOffest","_name":"_UnloadPickUpOffest","_id":"6bda5aa3-4a01-408a-8398-fb874e6b6a55","$type":"NodeCanvas.Framework.Variable`1[[System.Single, + mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]"},"_UnloadPutDownOffest":{"_propertyPath":"GameLogic.ShelfMachineToolActor._UnloadPutDownOffest","_name":"_UnloadPutDownOffest","_id":"73b620e7-05e7-47b4-83dc-e00c8c4c29d5","$type":"NodeCanvas.Framework.Variable`1[[System.Single, + mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]"}}}' + objectReference: {fileID: 0} + - target: {fileID: 674022236643372559, guid: 7827ccff2c5319541bbaf34e30e83074, type: 3} + propertyPath: _serializedVariables.Array.size + value: 5 + objectReference: {fileID: 0} + - target: {fileID: 674022236643372559, guid: 7827ccff2c5319541bbaf34e30e83074, type: 3} + propertyPath: _serializedVariables.Array.data[1]._json + value: '{"_propertyPath":"GameLogic.ShelfMachineToolActor._loadPickUpOffest","_name":"_loadPickUpOffest","_id":"97896196-eb4a-41b5-aad8-71e9be09393f","$type":"NodeCanvas.Framework.Variable`1[[System.Single, + mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]"}' + objectReference: {fileID: 0} + - target: {fileID: 674022236643372559, guid: 7827ccff2c5319541bbaf34e30e83074, type: 3} + propertyPath: _serializedVariables.Array.data[2]._json + value: '{"_propertyPath":"GameLogic.ShelfMachineToolActor._loadPutDownOffest","_name":"_loadPutDownOffest","_id":"2bac7793-b579-4ca3-9d5f-24570d649411","$type":"NodeCanvas.Framework.Variable`1[[System.Single, + mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]"}' + objectReference: {fileID: 0} + - target: {fileID: 674022236643372559, guid: 7827ccff2c5319541bbaf34e30e83074, type: 3} + propertyPath: _serializedVariables.Array.data[3]._json + value: '{"_propertyPath":"GameLogic.ShelfMachineToolActor._UnloadPickUpOffest","_name":"_UnloadPickUpOffest","_id":"6bda5aa3-4a01-408a-8398-fb874e6b6a55","$type":"NodeCanvas.Framework.Variable`1[[System.Single, + mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]"}' + objectReference: {fileID: 0} + - target: {fileID: 674022236643372559, guid: 7827ccff2c5319541bbaf34e30e83074, type: 3} + propertyPath: _serializedVariables.Array.data[4]._json + value: '{"_propertyPath":"GameLogic.ShelfMachineToolActor._UnloadPutDownOffest","_name":"_UnloadPutDownOffest","_id":"73b620e7-05e7-47b4-83dc-e00c8c4c29d5","$type":"NodeCanvas.Framework.Variable`1[[System.Single, + mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]"}' + objectReference: {fileID: 0} - target: {fileID: 690437541279941010, guid: 7827ccff2c5319541bbaf34e30e83074, type: 3} propertyPath: m_Name value: 03-15-02