部分修改

This commit is contained in:
SnowShow 2025-05-09 15:30:23 +08:00
parent 2657b3b1d0
commit 45d5456a81
14 changed files with 229 additions and 51 deletions

View File

@ -110,4 +110,6 @@ MonoBehaviour:
- Name:
Entry: 8
Data:
deviceCode: DDJ01
deviceType: STACKER
groups: 010000000300000004000000

File diff suppressed because one or more lines are too long

View File

@ -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

View File

@ -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;
// }
//
// }
}
/// <summary>

View File

@ -44,7 +44,7 @@ namespace GameLogic
/// <summary>
/// 取货
/// </summary>
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);
}

View File

@ -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();

View File

@ -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<T>()
{
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<ShelfActor>();
_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<StackerData>(JsonConvert.SerializeObject(data));
// //frontHasGoodsDesc = stackerData.frontForkHasGoods == true ? "ǰ²æÓлõ" : "ÎÞ»õ";
// var deviceData = JsonConvert.DeserializeObject<DeviceData>(JsonConvert.SerializeObject(other));
// Debug.Log(StackerDeviceDataUtility.GetPositionInfo(stackerData));
// if (stackerData.frontForkHasGoods);
// {
//
// }
}
}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 20e0d00e57698f84887368e168629083

View File

@ -21,6 +21,7 @@ namespace GameLogic
var array = data.Split('-');
return int.Parse(array[2]);
}
}
}

View File

@ -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<int> groups = new List<int>();
[LabelText("伸缩动画"),ShowInInspector]public Dictionary<int,ShelfRowAnimData> shelfAnimDatas = new Dictionary<int, ShelfRowAnimData>();

View File

@ -0,0 +1,20 @@
using UnityEngine;
namespace GameLogic
{
public static class StackerDeviceDataUtility
{
/// <summary>
/// 获取货物或者站点位置信息
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public static string GetPositionInfo(StackerData data)
{
return $"{data.toRow}-{data.frontColumn}-{data.toLayer}";
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 867844248f7945388f0f41f9c0543888
timeCreated: 1746773217

View File

@ -4,20 +4,49 @@ using System;
[System.Serializable]
public class StackerData
{
/// <summary>
/// 货物条码号
/// </summary>
public string frontContainerCode;
public string frontInstructionCode;
// /// <summary>
// /// 货物条码号
// /// </summary>
public string frontInstructionCode;
//public string frontFrom;
//public bool? frontStatus;
/// <summary>
/// 货物状态描述
/// </summary>
public string frontStatusDescription;
//public string backContainerCode;
//public string backInstructionCode;
//public string backTo;
//public string backStatusDescription;
public int roadway;
/// <summary>
/// 货物的排
/// </summary>
public int frontRow;
public int frontColumn;
/// <summary>
/// 货物的层
/// </summary>
public int frontLayer;
/// <summary>
/// 货物的列
/// </summary>
public int special1;
/// <summary>
/// 动作信号
/// </summary>
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;
/// <summary>
/// 有货信号
/// </summary>
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;
/// <summary>
/// 存放容器地址排
/// </summary>
public int toRow;
/// <summary>
/// 货物存放容器地址列
/// </summary>
public int toColumn;
/// <summary>
/// 货物存放容器地址层
/// </summary>
public int toLayer;
public int toCommand;
public string toCommandDescription;

View File

@ -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