From b9676adc299be561766d278a497c9d3a4ea4c6b4 Mon Sep 17 00:00:00 2001 From: yulong <1838206582@qq.com> Date: Sat, 14 Sep 2024 09:08:18 +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/OutlineEffect/OutlineEffect/Outline.cs | 4 +- Assets/Scenes/TobaccoModelTest.unity | 156 ++++++++++++++++-- Assets/Scripts/MqttManager.cs | 38 ++++- Assets/Scripts/ShelfBoxModel.cs | 17 +- Assets/Scripts/YL/Deliveryfromstorage.cs | 78 ++++----- Assets/Scripts/YL/Interaction.cs | 24 ++- Assets/Scripts/YL/Loadingoperation.cs | 52 ++++++ Assets/Scripts/YL/Loadingoperation.cs.meta | 11 ++ Assets/Scripts/YL/Movetest.cs | 84 +++++----- Assets/Scripts/YL/Shippingoffthebox.cs | 76 ++++----- ProjectSettings/TimelineSettings.asset | 16 ++ 11 files changed, 414 insertions(+), 142 deletions(-) create mode 100644 Assets/Scripts/YL/Loadingoperation.cs create mode 100644 Assets/Scripts/YL/Loadingoperation.cs.meta create mode 100644 ProjectSettings/TimelineSettings.asset diff --git a/Assets/OutlineEffect/OutlineEffect/Outline.cs b/Assets/OutlineEffect/OutlineEffect/Outline.cs index 868738e..d1f0fca 100644 --- a/Assets/OutlineEffect/OutlineEffect/Outline.cs +++ b/Assets/OutlineEffect/OutlineEffect/Outline.cs @@ -83,8 +83,8 @@ namespace cakeslice { if (OutlineEffect.Instance.outlines.Count > 0) { - - OutlineEffect.Instance.outlines.Clear(); + + OutlineEffect.Instance.outlines.Clear(); } OutlineEffect.Instance?.AddOutline(this); } diff --git a/Assets/Scenes/TobaccoModelTest.unity b/Assets/Scenes/TobaccoModelTest.unity index 5610ffb..0e60859 100644 --- a/Assets/Scenes/TobaccoModelTest.unity +++ b/Assets/Scenes/TobaccoModelTest.unity @@ -23490,7 +23490,7 @@ PrefabInstance: serializedVersion: 2 m_Modification: serializedVersion: 3 - m_TransformParent: {fileID: 1408424522} + m_TransformParent: {fileID: 1458458471} m_Modifications: - target: {fileID: 6148073173889382962, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3} propertyPath: m_Size.x @@ -23504,6 +23504,10 @@ PrefabInstance: propertyPath: m_Size.z value: 0.26762486 objectReference: {fileID: 0} + - target: {fileID: 6148073173889382962, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3} + propertyPath: m_Enabled + value: 0 + objectReference: {fileID: 0} - target: {fileID: 6148073173889382962, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3} propertyPath: m_Center.x value: 0.016736269 @@ -23577,6 +23581,9 @@ PrefabInstance: - targetCorrespondingSourceObject: {fileID: 9159787642519714698, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3} insertIndex: -1 addedObject: {fileID: 562540041} + - targetCorrespondingSourceObject: {fileID: 9159787642519714698, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3} + insertIndex: -1 + addedObject: {fileID: 562540044} m_SourcePrefab: {fileID: 100100000, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3} --- !u!4 &562540023 stripped Transform: @@ -23628,6 +23635,18 @@ MonoBehaviour: m_EditorClassIdentifier: color: 1 eraseRenderer: 0 +--- !u!114 &562540044 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 522367864} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7edafe89f5afc82419ea88236d9f0557, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &562583548 GameObject: m_ObjectHideFlags: 0 @@ -53557,7 +53576,7 @@ PrefabInstance: serializedVersion: 2 m_Modification: serializedVersion: 3 - m_TransformParent: {fileID: 1408424522} + m_TransformParent: {fileID: 1458458471} m_Modifications: - target: {fileID: 6148073173889382962, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3} propertyPath: m_Size.x @@ -53649,6 +53668,9 @@ PrefabInstance: - targetCorrespondingSourceObject: {fileID: 9159787642519714698, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3} insertIndex: -1 addedObject: {fileID: 1204163216} + - targetCorrespondingSourceObject: {fileID: 9159787642519714698, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3} + insertIndex: -1 + addedObject: {fileID: 1204163219} m_SourcePrefab: {fileID: 100100000, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3} --- !u!4 &1204163203 stripped Transform: @@ -53695,6 +53717,18 @@ MonoBehaviour: m_EditorClassIdentifier: color: 1 eraseRenderer: 0 +--- !u!114 &1204163219 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 918056124} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7edafe89f5afc82419ea88236d9f0557, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &1204959487 GameObject: m_ObjectHideFlags: 0 @@ -57433,7 +57467,7 @@ PrefabInstance: serializedVersion: 2 m_Modification: serializedVersion: 3 - m_TransformParent: {fileID: 1408424522} + m_TransformParent: {fileID: 1458458471} m_Modifications: - target: {fileID: 6148073173889382962, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3} propertyPath: m_Size.x @@ -57525,6 +57559,9 @@ PrefabInstance: - targetCorrespondingSourceObject: {fileID: 9159787642519714698, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3} insertIndex: -1 addedObject: {fileID: 1284009794} + - targetCorrespondingSourceObject: {fileID: 9159787642519714698, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3} + insertIndex: -1 + addedObject: {fileID: 1284009797} m_SourcePrefab: {fileID: 100100000, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3} --- !u!4 &1284009779 stripped Transform: @@ -57576,6 +57613,18 @@ MonoBehaviour: m_EditorClassIdentifier: color: 1 eraseRenderer: 0 +--- !u!114 &1284009797 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 382662699} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7edafe89f5afc82419ea88236d9f0557, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &1285421206 GameObject: m_ObjectHideFlags: 0 @@ -62898,14 +62947,6 @@ Transform: m_Children: - {fileID: 1183320051} - {fileID: 1458458471} - - {fileID: 4512223797691641496} - - {fileID: 562540023} - - {fileID: 1445132211} - - {fileID: 1284009779} - - {fileID: 1624341918} - - {fileID: 1204163203} - - {fileID: 2008920481} - - {fileID: 1948978127} - {fileID: 1465442209} - {fileID: 1422980367} - {fileID: 1982215674} @@ -64183,7 +64224,7 @@ PrefabInstance: serializedVersion: 2 m_Modification: serializedVersion: 3 - m_TransformParent: {fileID: 1408424522} + m_TransformParent: {fileID: 1458458471} m_Modifications: - target: {fileID: 6148073173889382962, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3} propertyPath: m_Size.x @@ -64268,6 +64309,9 @@ PrefabInstance: - targetCorrespondingSourceObject: {fileID: 9159787642519714698, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3} insertIndex: -1 addedObject: {fileID: 1445132225} + - targetCorrespondingSourceObject: {fileID: 9159787642519714698, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3} + insertIndex: -1 + addedObject: {fileID: 1445132228} m_SourcePrefab: {fileID: 100100000, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3} --- !u!4 &1445132211 stripped Transform: @@ -64302,6 +64346,18 @@ MonoBehaviour: m_EditorClassIdentifier: color: 1 eraseRenderer: 0 +--- !u!114 &1445132228 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 659521673} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7edafe89f5afc82419ea88236d9f0557, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &1450464936 GameObject: m_ObjectHideFlags: 0 @@ -64580,6 +64636,14 @@ Transform: - {fileID: 426204729} - {fileID: 1861024049} - {fileID: 86759265} + - {fileID: 4512223797691641496} + - {fileID: 562540023} + - {fileID: 1445132211} + - {fileID: 1284009779} + - {fileID: 1624341918} + - {fileID: 1204163203} + - {fileID: 2008920481} + - {fileID: 1948978127} m_Father: {fileID: 1408424522} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1462240599 @@ -70911,7 +70975,7 @@ PrefabInstance: serializedVersion: 2 m_Modification: serializedVersion: 3 - m_TransformParent: {fileID: 1408424522} + m_TransformParent: {fileID: 1458458471} m_Modifications: - target: {fileID: 6148073173889382962, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3} propertyPath: m_Size.x @@ -71000,6 +71064,9 @@ PrefabInstance: - targetCorrespondingSourceObject: {fileID: 9159787642519714698, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3} insertIndex: -1 addedObject: {fileID: 1624341930} + - targetCorrespondingSourceObject: {fileID: 9159787642519714698, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3} + insertIndex: -1 + addedObject: {fileID: 1624341933} m_SourcePrefab: {fileID: 100100000, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3} --- !u!4 &1624341918 stripped Transform: @@ -71034,6 +71101,18 @@ MonoBehaviour: m_EditorClassIdentifier: color: 1 eraseRenderer: 0 +--- !u!114 &1624341933 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 792718476} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7edafe89f5afc82419ea88236d9f0557, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &1624945031 GameObject: m_ObjectHideFlags: 0 @@ -78149,7 +78228,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 1, y: 1} m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: -59.399902, y: -66} + m_AnchoredPosition: {x: -60, y: -66} m_SizeDelta: {x: 100, y: 32} m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &1784045168 @@ -86550,7 +86629,7 @@ PrefabInstance: serializedVersion: 2 m_Modification: serializedVersion: 3 - m_TransformParent: {fileID: 1408424522} + m_TransformParent: {fileID: 1458458471} m_Modifications: - target: {fileID: 4166535823548997321, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3} propertyPath: m_BlendShapeWeights.Array.data[0] @@ -86646,6 +86725,9 @@ PrefabInstance: - targetCorrespondingSourceObject: {fileID: 9159787642519714698, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3} insertIndex: -1 addedObject: {fileID: 1948978140} + - targetCorrespondingSourceObject: {fileID: 9159787642519714698, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3} + insertIndex: -1 + addedObject: {fileID: 1948978143} m_SourcePrefab: {fileID: 100100000, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3} --- !u!4 &1948978127 stripped Transform: @@ -86693,6 +86775,18 @@ MonoBehaviour: m_EditorClassIdentifier: color: 1 eraseRenderer: 0 +--- !u!114 &1948978143 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 499417481} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7edafe89f5afc82419ea88236d9f0557, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &1951452093 GameObject: m_ObjectHideFlags: 0 @@ -89167,7 +89261,7 @@ PrefabInstance: serializedVersion: 2 m_Modification: serializedVersion: 3 - m_TransformParent: {fileID: 1408424522} + m_TransformParent: {fileID: 1458458471} m_Modifications: - target: {fileID: 6148073173889382962, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3} propertyPath: m_Size.x @@ -89259,6 +89353,9 @@ PrefabInstance: - targetCorrespondingSourceObject: {fileID: 9159787642519714698, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3} insertIndex: -1 addedObject: {fileID: 2008920496} + - targetCorrespondingSourceObject: {fileID: 9159787642519714698, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3} + insertIndex: -1 + addedObject: {fileID: 2008920499} m_SourcePrefab: {fileID: 100100000, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3} --- !u!4 &2008920481 stripped Transform: @@ -89305,6 +89402,18 @@ MonoBehaviour: m_EditorClassIdentifier: color: 1 eraseRenderer: 0 +--- !u!114 &2008920499 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 522572449} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7edafe89f5afc82419ea88236d9f0557, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &2014946757 GameObject: m_ObjectHideFlags: 0 @@ -119986,6 +120095,7 @@ GameObject: - component: {fileID: 8293918688537252195} - component: {fileID: 8293918688537252196} - component: {fileID: 8293918688537252197} + - component: {fileID: 8293918688537252198} m_Layer: 0 m_Name: car1 m_TagString: Car @@ -123905,7 +124015,7 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] - m_Father: {fileID: 1408424522} + m_Father: {fileID: 1458458471} m_LocalEulerAnglesHint: {x: -90, y: 0, z: 90} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} @@ -146766,6 +146876,18 @@ MonoBehaviour: m_EditorClassIdentifier: color: 1 eraseRenderer: 0 +--- !u!114 &8293918688537252198 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3879133165445002274} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7edafe89f5afc82419ea88236d9f0557, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &8294194876234541303 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/MqttManager.cs b/Assets/Scripts/MqttManager.cs index 41d0fa1..055a78f 100644 --- a/Assets/Scripts/MqttManager.cs +++ b/Assets/Scripts/MqttManager.cs @@ -1,4 +1,5 @@ using System; +using System.Collections; using System.Collections.Concurrent; using System.Collections.Generic; using System.Runtime.InteropServices; @@ -158,7 +159,7 @@ public class MqttManager : MonoSingleton } } } - public void Carpoint(GameObject car, Carequipment carequipment) + public void Carpoint(GameObject car, Carequipment carequipment) { Debug.Log(carequipment.id); if (car) @@ -166,9 +167,40 @@ public class MqttManager : MonoSingleton Carinformation carbox = car.GetComponent(); carbox.BoxCode = carequipment.CarState_BoxCode; string point = carequipment.CarState_Car_Column + "-" + carequipment.CarState_Car_Row + "-" + carequipment.CarState_Car_Layer; - //Debug.Log(point); - //GameObject displacement = GameObject.Find(point); + + GameObject displacement = GameObject.Find(point); //car.transform.DOMove(displacement.transform.position, Vector3.Distance(car.transform.position, displacement.transform.position) / speed).SetEase(Ease.InOutQuad); + Designateddisplacement(car, displacement.transform.position, speed); + if (carequipment.CarState_CarPlt == "上升") + { + BoxCollider cars = car.GetComponent(); + cars.enabled = true; + } + else if (carequipment.CarState_CarPlt == "下降") + { + //BoxCollider cars = car.GetComponent(); + //cars.enabled = true; + GameObject box = car.transform.GetChild(0).gameObject; + float dis = box.transform.position.y - 0.3f; + box.transform.DOMoveY(dis, 0.2f).SetEase(Ease.OutQuad); + car.transform.SetParent(null); + } + else + { + BoxCollider cars = car.GetComponent(); + cars.enabled = false; + } } } + /// + /// 需要位移的地方 + /// + /// 小车 + /// 位移到指定位置 + /// 位移的速度 + public void Designateddisplacement(GameObject car, Vector3 dis, float speed) + { + float times = Vector3.Distance(car.transform.position, dis) / speed; + car.transform.DOMove(dis, times).SetEase(Ease.InOutQuad); + } } \ No newline at end of file diff --git a/Assets/Scripts/ShelfBoxModel.cs b/Assets/Scripts/ShelfBoxModel.cs index 2a364ea..347115a 100644 --- a/Assets/Scripts/ShelfBoxModel.cs +++ b/Assets/Scripts/ShelfBoxModel.cs @@ -649,6 +649,7 @@ namespace DefaultNamespace [Serializable] public class Hoisters { + public bool isOnline; /// /// /// @@ -843,7 +844,7 @@ namespace DefaultNamespace /// /// /// - public string fauleFree; + public string faultFree; /// /// /// @@ -1000,6 +1001,7 @@ namespace DefaultNamespace [Serializable] public class RPalletizers { + public bool isOnline; /// /// /// @@ -1218,6 +1220,7 @@ namespace DefaultNamespace [Serializable] public class Batterys { + public bool isOnline; /// /// /// @@ -1508,6 +1511,10 @@ namespace DefaultNamespace [Serializable] public class FeequMessage { + /// + /// 判断是否在线 + /// + public bool isOnline; /// /// /// @@ -1744,6 +1751,10 @@ namespace DefaultNamespace [Serializable] public class Decappings { + /// + /// 判断是否在线 + /// + public bool isOnline; /// /// /// @@ -1910,6 +1921,10 @@ namespace DefaultNamespace [Serializable] public class Conveyordata { + /// + /// + /// + public bool isOnline; /// /// /// diff --git a/Assets/Scripts/YL/Deliveryfromstorage.cs b/Assets/Scripts/YL/Deliveryfromstorage.cs index f46fa7f..7c7bde1 100644 --- a/Assets/Scripts/YL/Deliveryfromstorage.cs +++ b/Assets/Scripts/YL/Deliveryfromstorage.cs @@ -64,47 +64,47 @@ public class Deliveryfromstorage : MonoBehaviour await transform.DOMove(point7.transform.position, (Vector3.Distance(transform.position, point7.transform.position) / speed)).SetEase(Ease.Linear).AsyncWaitForCompletion(); } - private void OnTriggerEnter(Collider other) - { + //private void OnTriggerEnter(Collider other) + //{ - if (other.gameObject.CompareTag("Box")) - { - Carinformation car = transform.GetComponent(); - Boxinformation boxinformation = other.gameObject.transform.GetComponent(); - if (car && boxinformation) - { - boxinformation.ID = car.BoxCode; - Debug.Log(boxinformation.ID); - } - Debug.Log(""); - other.transform.position = new Vector3(other.transform.position.x, other.transform.position.y + 0.2f, other.transform.position.z); - //other.transform.position = new Vector3(other.transform.position.x, other.transform.position.y - 0.2f, other.transform.position.z); - if (other.gameObject != null) - { - // ȡײ - Collider triggerCollider = GetComponent(); + // if (other.gameObject.CompareTag("Box")) + // { + // Carinformation car = transform.GetComponent(); + // Boxinformation boxinformation = other.gameObject.transform.GetComponent(); + // if (car && boxinformation) + // { + // boxinformation.ID = car.BoxCode; + // Debug.Log(boxinformation.ID); + // } + // Debug.Log(""); + // other.transform.position = new Vector3(other.transform.position.x, other.transform.position.y + 0.2f, other.transform.position.z); + // //other.transform.position = new Vector3(other.transform.position.x, other.transform.position.y - 0.2f, other.transform.position.z); + // if (other.gameObject != null) + // { + // // ȡײ + // Collider triggerCollider = GetComponent(); - // ȷײ - if (triggerCollider != null) - { - // 㴥嶥 - Vector3 triggerPosition = triggerCollider.bounds.center; - Vector3 triggerTop = triggerPosition + Vector3.up * (triggerCollider.bounds.extents.y + -0.2f); + // // ȷײ + // if (triggerCollider != null) + // { + // // 㴥嶥 + // Vector3 triggerPosition = triggerCollider.bounds.center; + // Vector3 triggerTop = triggerPosition + Vector3.up * (triggerCollider.bounds.extents.y + -0.2f); - // λ - other.transform.position = triggerTop; - other.transform.SetParent(transform); - } - else - { - Debug.LogError("ûײ"); - } - } - else - { - Debug.LogError("ײ"); - } - } - } + // // λ + // other.transform.position = triggerTop; + // other.transform.SetParent(transform); + // } + // else + // { + // Debug.LogError("ûײ"); + // } + // } + // else + // { + // Debug.LogError("ײ"); + // } + // } + //} } diff --git a/Assets/Scripts/YL/Interaction.cs b/Assets/Scripts/YL/Interaction.cs index a60797c..a95bbcd 100644 --- a/Assets/Scripts/YL/Interaction.cs +++ b/Assets/Scripts/YL/Interaction.cs @@ -1,3 +1,4 @@ +using cakeslice; using DefaultNamespace; using System; using UnityEngine; @@ -121,6 +122,7 @@ public class Interaction : MonoBehaviour UIDeviceBaseInfoPanel.Getdata(cardata.type, cardata.time, cardata.result.id, cardata.result.boxCode, cardata.result.car_Layer, cardata.result.car_X, cardata.result.car_Y, cardata.result.carPLT, cardata.result.error1, cardata.result.error2, cardata.result.error3, cardata.result.error4, cardata.result.error5, "", () => { + UIDeviceBaseInfoPanel.gameObject.SetActive(false); }); @@ -157,7 +159,7 @@ public class Interaction : MonoBehaviour } if (hit.collider.CompareTag("Hoister")) { - + Consentmark hoistinformation = hit.collider.gameObject.GetComponent(); // Debug.Log(hoistinformation.ID); string url = Hoisinterface + hoistinformation.ID; @@ -170,9 +172,10 @@ public class Interaction : MonoBehaviour UIHoister.Gethoister(elevatdata.result.taskNumber, elevatdata.result.currentLayer, elevatdata.result.targetLayer, elevatdata.result.startingLayer, elevatdata.result.workingStatus, elevatdata.result.lowerBoxNumber, elevatdata.result.descent, elevatdata.result.forwardCargoInspection, elevatdata.result.downInPlaceInspection, elevatdata.result.upperInPlaceInspection, elevatdata.result.overboundaryInspection1, elevatdata.result.overboundaryInspection2, elevatdata.result.upperlimitInspection, - elevatdata.result.lowerlimitInspection, elevatdata.result.conveyingForwardOperation, elevatdata.result.deliveryTimeoutFault, elevatdata.result.fauleFree, elevatdata.result.carRGVInspection1, + elevatdata.result.lowerlimitInspection, elevatdata.result.conveyingForwardOperation, elevatdata.result.deliveryTimeoutFault, elevatdata.result.faultFree, elevatdata.result.carRGVInspection1, elevatdata.result.liftAirSwitchFault, elevatdata.result.carRGVInspection2, elevatdata.result.deliveryControllerFault, elevatdata.result.deliveryIsolationSwitchFault, elevatdata.result.liftAirSwitchFault, () => { + Removeprompt(); UIHoister.gameObject.SetActive(false); }); UIHoister.gameObject.SetActive(true); @@ -195,6 +198,7 @@ public class Interaction : MonoBehaviour palletizer.result.faultFree, palletizer.result.leftCargoForkExtensionFork, palletizer.result.liftAirSwitchFault, palletizer.result.liftControllerFault, palletizer.result.leftForkIsolationFault, palletizer.result.rightForkIsolationFault, palletizer.result.liftIsolatingFault, () => { + Removeprompt(); UIPalletizer.gameObject.SetActive(false); }); UIPalletizer.gameObject.SetActive(true); @@ -215,6 +219,7 @@ public class Interaction : MonoBehaviour batterydata.result.retractingClaws, batterydata.result.upperInPlace, batterydata.result.lowerInPlace, batterydata.result.hookClawInPlace, batterydata.result.clawRetractedInPlace, batterydata.result.walkingAirSwitchFault, batterydata.result.liftAirSwitchFault, batterydata.result.walkControllerFault, batterydata.result.liftControllerFault, batterydata.result.forkExtensionTimeoutFault, batterydata.result.forkRetractionTimeoutFault, () => { + Removeprompt(); UIReplacebattery.gameObject.SetActive(false); }); UIReplacebattery.gameObject.SetActive(true); @@ -235,6 +240,7 @@ public class Interaction : MonoBehaviour outofthe.result.cleanMark, outofthe.result.lowerBoxTobaccoWeight, outofthe.result.samplingInspectionMark, outofthe.result.boxesNumber, outofthe.result.faultFree, outofthe.result.deliveryControllerFault, outofthe.result.deviceStatus, outofthe.result.deliveryTimeoutFault, outofthe.result.deliveryAirSwitchFault, outofthe.result.deliveryIsolationSwitchFault, () => { + Removeprompt(); UIConveyorpanel.gameObject.SetActive(false); }); UIConveyorpanel.gameObject.SetActive(true); @@ -255,6 +261,7 @@ public class Interaction : MonoBehaviour intothe.result.cleanMark, intothe.result.lowerBoxTobaccoWeight, intothe.result.samplingInspectionMark, intothe.result.boxesNumber, intothe.result.faultFree, intothe.result.deliveryControllerFault, intothe.result.deviceStatus, intothe.result.deliveryTimeoutFault, intothe.result.deliveryAirSwitchFault, intothe.result.deliveryIsolationSwitchFault, () => { + Removeprompt(); UIConveyorpanel.gameObject.SetActive(false); }); UIConveyorpanel.gameObject.SetActive(true); @@ -276,6 +283,7 @@ public class Interaction : MonoBehaviour feequipments.result.faultFree, feequipments.result.liftAirSwitchFault, feequipments.result.liftControllerFault, feequipments.result.liftIsolatingSwitchFault, feequipments.result.upperLimitFault, feequipments.result.lowerLimitFault, feequipments.result.deliveryControllerFault, feequipments.result.deliveryIsolationFault, feequipments.result.deliveryTimeoutFault, feequipments.result.transboundaryFault, () => { + Removeprompt(); UIFloorelevator.gameObject.SetActive(false); }); UIFloorelevator.gameObject.SetActive(true); @@ -299,6 +307,7 @@ public class Interaction : MonoBehaviour decappingmachine.result.lowerInPlace, decappingmachine.result.ascendingClampRun, decappingmachine.result.loweringReleasingCoverRun, decappingmachine.result.faultFree, decappingmachine.result.runningEmptyBreakdownFault, decappingmachine.result.runningControllerFault, decappingmachine.result.runningIsolationFault, decappingmachine.result.preRunLimitFault, decappingmachine.result.postRunLimitFault, decappingmachine.result.cylinderRiseTimeoutFault, decappingmachine.result.cylinderLoweringTimeoutFault, () => { + Removeprompt(); UICoverremovalmachine.gameObject.SetActive(false); }); UICoverremovalmachine.gameObject.SetActive(true); @@ -307,4 +316,15 @@ public class Interaction : MonoBehaviour } } } + /// + /// Ƴʾ + /// + private void Removeprompt() + { + if (OutlineEffect.Instance.outlines.Count > 0) + { + OutlineEffect.Instance.outlines.Clear(); + } + } + } diff --git a/Assets/Scripts/YL/Loadingoperation.cs b/Assets/Scripts/YL/Loadingoperation.cs new file mode 100644 index 0000000..7869fd1 --- /dev/null +++ b/Assets/Scripts/YL/Loadingoperation.cs @@ -0,0 +1,52 @@ +using DG.Tweening; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class Loadingoperation : MonoBehaviour +{ + /// + /// + /// + /// + private void OnTriggerEnter(Collider other) + { + + if (other.gameObject.CompareTag("Box")) + { + Carinformation car = transform.GetComponent(); + Boxinformation boxinformation = other.gameObject.transform.GetComponent(); + if (car && boxinformation) + { + boxinformation.ID = car.BoxCode; + } + float pos = other.transform.position.y + 0.3f; + other.transform.DOMoveY(pos, 0.3f).SetEase(Ease.InOutQuad); + other.transform.SetParent(transform); + if (other.gameObject != null) + { + // ȡײ + Collider triggerCollider = GetComponent(); + + // ȷײ + if (triggerCollider != null) + { + // 㴥嶥 + Vector3 triggerPosition = triggerCollider.bounds.center; + Vector3 triggerTop = triggerPosition + Vector3.up * (triggerCollider.bounds.extents.y + -0.2f); + + // λ + other.transform.position = triggerTop; + } + else + { + Debug.LogError("ûײ"); + } + } + else + { + Debug.LogError("ûлȡ"); + } + } + } +} diff --git a/Assets/Scripts/YL/Loadingoperation.cs.meta b/Assets/Scripts/YL/Loadingoperation.cs.meta new file mode 100644 index 0000000..40cd517 --- /dev/null +++ b/Assets/Scripts/YL/Loadingoperation.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7edafe89f5afc82419ea88236d9f0557 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/YL/Movetest.cs b/Assets/Scripts/YL/Movetest.cs index 081a568..762758b 100644 --- a/Assets/Scripts/YL/Movetest.cs +++ b/Assets/Scripts/YL/Movetest.cs @@ -13,6 +13,7 @@ public class Movetest : MonoBehaviour public Transform targetPosition; public float speed = 5; private bool isMoving = true; + private BoxCollider boxcollider; void Start() { @@ -20,7 +21,7 @@ public class Movetest : MonoBehaviour car1 = GameObject.Find("14-37-2"); tarton = car1.GetComponent(); - + boxcollider = transform.GetComponent(); _ = Planneddisplacement(); @@ -39,7 +40,9 @@ public class Movetest : MonoBehaviour Transform point4 = GameObject.Find("13-37-2").transform; await transform.DOMove(point4.transform.position, (Vector3.Distance(transform.position, point4.transform.position) / speed)).SetEase(Ease.InOutQuad).AsyncWaitForCompletion(); Transform point5 = GameObject.Find("14-37-2").transform; + boxcollider.enabled = true; await transform.DOMove(point5.transform.position, (Vector3.Distance(transform.position, point5.transform.position) / speed)).SetEase(Ease.InOutQuad).AsyncWaitForCompletion(); + boxcollider.enabled = false; await transform.DOMove(point4.transform.position, (Vector3.Distance(transform.position, point4.transform.position) / speed)).SetEase(Ease.InOutQuad).AsyncWaitForCompletion(); Transform point6 = GameObject.Find("13-39-2").transform; await transform.DOMove(point6.transform.position, (Vector3.Distance(transform.position, point6.transform.position) / speed)).SetEase(Ease.InOutQuad).AsyncWaitForCompletion(); @@ -52,51 +55,52 @@ public class Movetest : MonoBehaviour await transform.DOMove(point3.transform.position, (Vector3.Distance(transform.position, point3.transform.position) / speed)).SetEase(Ease.InOutQuad).AsyncWaitForCompletion(); Transform point8 = GameObject.Find("14-32-2").transform; await transform.DOMove(point8.transform.position, (Vector3.Distance(transform.position, point8.transform.position) / speed)).SetEase(Ease.InOutQuad).AsyncWaitForCompletion(); + boxcollider.enabled = true; } - private void OnTriggerEnter(Collider other) - { + //private void OnTriggerEnter(Collider other) + //{ - if (other.gameObject.CompareTag("Box")) - { - Carinformation car = transform.GetComponent(); - Boxinformation boxinformation = other.gameObject.transform.GetComponent(); - if (car && boxinformation) - { - boxinformation.ID = car.BoxCode; - //Debug.Log(boxinformation.ID); - } - //Debug.Log(""); - float pos = other.transform.position.y + 0.3f; - other.transform.DOMoveY(pos, 0.3f).SetEase(Ease.InOutQuad); - other.transform.SetParent(transform); - if (other.gameObject != null) - { - // ȡײ - Collider triggerCollider = GetComponent(); + // if (other.gameObject.CompareTag("Box")) + // { + // Carinformation car = transform.GetComponent(); + // Boxinformation boxinformation = other.gameObject.transform.GetComponent(); + // if (car && boxinformation) + // { + // boxinformation.ID = car.BoxCode; + // //Debug.Log(boxinformation.ID); + // } + // //Debug.Log(""); + // float pos = other.transform.position.y + 0.3f; + // other.transform.DOMoveY(pos, 0.3f).SetEase(Ease.InOutQuad); + // other.transform.SetParent(transform); + // if (other.gameObject != null) + // { + // // ȡײ + // Collider triggerCollider = GetComponent(); - // ȷײ - if (triggerCollider != null) - { - // 㴥嶥 - Vector3 triggerPosition = triggerCollider.bounds.center; - Vector3 triggerTop = triggerPosition + Vector3.up * (triggerCollider.bounds.extents.y + -0.2f); + // // ȷײ + // if (triggerCollider != null) + // { + // // 㴥嶥 + // Vector3 triggerPosition = triggerCollider.bounds.center; + // Vector3 triggerTop = triggerPosition + Vector3.up * (triggerCollider.bounds.extents.y + -0.2f); - // λ - other.transform.position = triggerTop; - } - else - { - Debug.LogError("Trigger object does not have a Collider component."); - } - } - else - { - Debug.LogError("Colliding object is not assigned."); - } - } - } + // // λ + // other.transform.position = triggerTop; + // } + // else + // { + // Debug.LogError("Trigger object does not have a Collider component."); + // } + // } + // else + // { + // Debug.LogError("Colliding object is not assigned."); + // } + // } + //} void Update() { diff --git a/Assets/Scripts/YL/Shippingoffthebox.cs b/Assets/Scripts/YL/Shippingoffthebox.cs index e7617a1..9baa666 100644 --- a/Assets/Scripts/YL/Shippingoffthebox.cs +++ b/Assets/Scripts/YL/Shippingoffthebox.cs @@ -34,45 +34,45 @@ public class Shippingoffthebox : MonoBehaviour { } - private void OnTriggerEnter(Collider other) - { + //private void OnTriggerEnter(Collider other) + //{ - if (other.gameObject.CompareTag("Box")) - { - Carinformation car = transform.GetComponent(); - Boxinformation boxinformation = other.gameObject.transform.GetComponent(); - if (car && boxinformation) - { - boxinformation.ID = car.BoxCode; - //Debug.Log(boxinformation.ID); - } - // Debug.Log(""); - //other.transform.SetParent(transform); - if (other.gameObject != null) - { - // ȡײ - Collider triggerCollider = GetComponent(); + // if (other.gameObject.CompareTag("Box")) + // { + // Carinformation car = transform.GetComponent(); + // Boxinformation boxinformation = other.gameObject.transform.GetComponent(); + // if (car && boxinformation) + // { + // boxinformation.ID = car.BoxCode; + // //Debug.Log(boxinformation.ID); + // } + // // Debug.Log(""); + // //other.transform.SetParent(transform); + // if (other.gameObject != null) + // { + // // ȡײ + // Collider triggerCollider = GetComponent(); - // ȷײ - if (triggerCollider != null) - { - // 㴥嶥 - Vector3 triggerPosition = triggerCollider.bounds.center; - Vector3 triggerTop = triggerPosition + Vector3.up * (triggerCollider.bounds.extents.y + -0.2f); + // // ȷײ + // if (triggerCollider != null) + // { + // // 㴥嶥 + // Vector3 triggerPosition = triggerCollider.bounds.center; + // Vector3 triggerTop = triggerPosition + Vector3.up * (triggerCollider.bounds.extents.y + -0.2f); - // λ - other.transform.position = triggerTop; - other.transform.SetParent(transform); - } - else - { - Debug.LogError("Trigger object does not have a Collider component."); - } - } - else - { - Debug.LogError("Colliding object is not assigned."); - } - } - } + // // λ + // other.transform.position = triggerTop; + // other.transform.SetParent(transform); + // } + // else + // { + // Debug.LogError("Trigger object does not have a Collider component."); + // } + // } + // else + // { + // Debug.LogError("Colliding object is not assigned."); + // } + // } + //} } diff --git a/ProjectSettings/TimelineSettings.asset b/ProjectSettings/TimelineSettings.asset new file mode 100644 index 0000000..b21943a --- /dev/null +++ b/ProjectSettings/TimelineSettings.asset @@ -0,0 +1,16 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &1 +MonoBehaviour: + m_ObjectHideFlags: 53 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a287be6c49135cd4f9b2b8666c39d999, type: 3} + m_Name: + m_EditorClassIdentifier: + assetDefaultFramerate: 60 + m_DefaultFrameRate: 60