This commit is contained in:
yulong 2024-09-14 09:08:18 +08:00
parent 68b7d570b6
commit b9676adc29
11 changed files with 414 additions and 142 deletions

View File

@ -83,8 +83,8 @@ namespace cakeslice
{ {
if (OutlineEffect.Instance.outlines.Count > 0) if (OutlineEffect.Instance.outlines.Count > 0)
{ {
OutlineEffect.Instance.outlines.Clear(); OutlineEffect.Instance.outlines.Clear();
} }
OutlineEffect.Instance?.AddOutline(this); OutlineEffect.Instance?.AddOutline(this);
} }

View File

@ -23490,7 +23490,7 @@ PrefabInstance:
serializedVersion: 2 serializedVersion: 2
m_Modification: m_Modification:
serializedVersion: 3 serializedVersion: 3
m_TransformParent: {fileID: 1408424522} m_TransformParent: {fileID: 1458458471}
m_Modifications: m_Modifications:
- target: {fileID: 6148073173889382962, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3} - target: {fileID: 6148073173889382962, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3}
propertyPath: m_Size.x propertyPath: m_Size.x
@ -23504,6 +23504,10 @@ PrefabInstance:
propertyPath: m_Size.z propertyPath: m_Size.z
value: 0.26762486 value: 0.26762486
objectReference: {fileID: 0} 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} - target: {fileID: 6148073173889382962, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3}
propertyPath: m_Center.x propertyPath: m_Center.x
value: 0.016736269 value: 0.016736269
@ -23577,6 +23581,9 @@ PrefabInstance:
- targetCorrespondingSourceObject: {fileID: 9159787642519714698, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3} - targetCorrespondingSourceObject: {fileID: 9159787642519714698, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3}
insertIndex: -1 insertIndex: -1
addedObject: {fileID: 562540041} addedObject: {fileID: 562540041}
- targetCorrespondingSourceObject: {fileID: 9159787642519714698, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3}
insertIndex: -1
addedObject: {fileID: 562540044}
m_SourcePrefab: {fileID: 100100000, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3}
--- !u!4 &562540023 stripped --- !u!4 &562540023 stripped
Transform: Transform:
@ -23628,6 +23635,18 @@ MonoBehaviour:
m_EditorClassIdentifier: m_EditorClassIdentifier:
color: 1 color: 1
eraseRenderer: 0 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 --- !u!1 &562583548
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -53557,7 +53576,7 @@ PrefabInstance:
serializedVersion: 2 serializedVersion: 2
m_Modification: m_Modification:
serializedVersion: 3 serializedVersion: 3
m_TransformParent: {fileID: 1408424522} m_TransformParent: {fileID: 1458458471}
m_Modifications: m_Modifications:
- target: {fileID: 6148073173889382962, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3} - target: {fileID: 6148073173889382962, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3}
propertyPath: m_Size.x propertyPath: m_Size.x
@ -53649,6 +53668,9 @@ PrefabInstance:
- targetCorrespondingSourceObject: {fileID: 9159787642519714698, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3} - targetCorrespondingSourceObject: {fileID: 9159787642519714698, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3}
insertIndex: -1 insertIndex: -1
addedObject: {fileID: 1204163216} addedObject: {fileID: 1204163216}
- targetCorrespondingSourceObject: {fileID: 9159787642519714698, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3}
insertIndex: -1
addedObject: {fileID: 1204163219}
m_SourcePrefab: {fileID: 100100000, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3}
--- !u!4 &1204163203 stripped --- !u!4 &1204163203 stripped
Transform: Transform:
@ -53695,6 +53717,18 @@ MonoBehaviour:
m_EditorClassIdentifier: m_EditorClassIdentifier:
color: 1 color: 1
eraseRenderer: 0 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 --- !u!1 &1204959487
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -57433,7 +57467,7 @@ PrefabInstance:
serializedVersion: 2 serializedVersion: 2
m_Modification: m_Modification:
serializedVersion: 3 serializedVersion: 3
m_TransformParent: {fileID: 1408424522} m_TransformParent: {fileID: 1458458471}
m_Modifications: m_Modifications:
- target: {fileID: 6148073173889382962, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3} - target: {fileID: 6148073173889382962, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3}
propertyPath: m_Size.x propertyPath: m_Size.x
@ -57525,6 +57559,9 @@ PrefabInstance:
- targetCorrespondingSourceObject: {fileID: 9159787642519714698, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3} - targetCorrespondingSourceObject: {fileID: 9159787642519714698, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3}
insertIndex: -1 insertIndex: -1
addedObject: {fileID: 1284009794} addedObject: {fileID: 1284009794}
- targetCorrespondingSourceObject: {fileID: 9159787642519714698, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3}
insertIndex: -1
addedObject: {fileID: 1284009797}
m_SourcePrefab: {fileID: 100100000, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3}
--- !u!4 &1284009779 stripped --- !u!4 &1284009779 stripped
Transform: Transform:
@ -57576,6 +57613,18 @@ MonoBehaviour:
m_EditorClassIdentifier: m_EditorClassIdentifier:
color: 1 color: 1
eraseRenderer: 0 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 --- !u!1 &1285421206
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -62898,14 +62947,6 @@ Transform:
m_Children: m_Children:
- {fileID: 1183320051} - {fileID: 1183320051}
- {fileID: 1458458471} - {fileID: 1458458471}
- {fileID: 4512223797691641496}
- {fileID: 562540023}
- {fileID: 1445132211}
- {fileID: 1284009779}
- {fileID: 1624341918}
- {fileID: 1204163203}
- {fileID: 2008920481}
- {fileID: 1948978127}
- {fileID: 1465442209} - {fileID: 1465442209}
- {fileID: 1422980367} - {fileID: 1422980367}
- {fileID: 1982215674} - {fileID: 1982215674}
@ -64183,7 +64224,7 @@ PrefabInstance:
serializedVersion: 2 serializedVersion: 2
m_Modification: m_Modification:
serializedVersion: 3 serializedVersion: 3
m_TransformParent: {fileID: 1408424522} m_TransformParent: {fileID: 1458458471}
m_Modifications: m_Modifications:
- target: {fileID: 6148073173889382962, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3} - target: {fileID: 6148073173889382962, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3}
propertyPath: m_Size.x propertyPath: m_Size.x
@ -64268,6 +64309,9 @@ PrefabInstance:
- targetCorrespondingSourceObject: {fileID: 9159787642519714698, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3} - targetCorrespondingSourceObject: {fileID: 9159787642519714698, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3}
insertIndex: -1 insertIndex: -1
addedObject: {fileID: 1445132225} addedObject: {fileID: 1445132225}
- targetCorrespondingSourceObject: {fileID: 9159787642519714698, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3}
insertIndex: -1
addedObject: {fileID: 1445132228}
m_SourcePrefab: {fileID: 100100000, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3}
--- !u!4 &1445132211 stripped --- !u!4 &1445132211 stripped
Transform: Transform:
@ -64302,6 +64346,18 @@ MonoBehaviour:
m_EditorClassIdentifier: m_EditorClassIdentifier:
color: 1 color: 1
eraseRenderer: 0 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 --- !u!1 &1450464936
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -64580,6 +64636,14 @@ Transform:
- {fileID: 426204729} - {fileID: 426204729}
- {fileID: 1861024049} - {fileID: 1861024049}
- {fileID: 86759265} - {fileID: 86759265}
- {fileID: 4512223797691641496}
- {fileID: 562540023}
- {fileID: 1445132211}
- {fileID: 1284009779}
- {fileID: 1624341918}
- {fileID: 1204163203}
- {fileID: 2008920481}
- {fileID: 1948978127}
m_Father: {fileID: 1408424522} m_Father: {fileID: 1408424522}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1462240599 --- !u!1 &1462240599
@ -70911,7 +70975,7 @@ PrefabInstance:
serializedVersion: 2 serializedVersion: 2
m_Modification: m_Modification:
serializedVersion: 3 serializedVersion: 3
m_TransformParent: {fileID: 1408424522} m_TransformParent: {fileID: 1458458471}
m_Modifications: m_Modifications:
- target: {fileID: 6148073173889382962, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3} - target: {fileID: 6148073173889382962, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3}
propertyPath: m_Size.x propertyPath: m_Size.x
@ -71000,6 +71064,9 @@ PrefabInstance:
- targetCorrespondingSourceObject: {fileID: 9159787642519714698, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3} - targetCorrespondingSourceObject: {fileID: 9159787642519714698, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3}
insertIndex: -1 insertIndex: -1
addedObject: {fileID: 1624341930} addedObject: {fileID: 1624341930}
- targetCorrespondingSourceObject: {fileID: 9159787642519714698, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3}
insertIndex: -1
addedObject: {fileID: 1624341933}
m_SourcePrefab: {fileID: 100100000, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3}
--- !u!4 &1624341918 stripped --- !u!4 &1624341918 stripped
Transform: Transform:
@ -71034,6 +71101,18 @@ MonoBehaviour:
m_EditorClassIdentifier: m_EditorClassIdentifier:
color: 1 color: 1
eraseRenderer: 0 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 --- !u!1 &1624945031
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -78149,7 +78228,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 1} m_AnchorMin: {x: 1, y: 1}
m_AnchorMax: {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_SizeDelta: {x: 100, y: 32}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &1784045168 --- !u!1 &1784045168
@ -86550,7 +86629,7 @@ PrefabInstance:
serializedVersion: 2 serializedVersion: 2
m_Modification: m_Modification:
serializedVersion: 3 serializedVersion: 3
m_TransformParent: {fileID: 1408424522} m_TransformParent: {fileID: 1458458471}
m_Modifications: m_Modifications:
- target: {fileID: 4166535823548997321, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3} - target: {fileID: 4166535823548997321, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3}
propertyPath: m_BlendShapeWeights.Array.data[0] propertyPath: m_BlendShapeWeights.Array.data[0]
@ -86646,6 +86725,9 @@ PrefabInstance:
- targetCorrespondingSourceObject: {fileID: 9159787642519714698, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3} - targetCorrespondingSourceObject: {fileID: 9159787642519714698, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3}
insertIndex: -1 insertIndex: -1
addedObject: {fileID: 1948978140} addedObject: {fileID: 1948978140}
- targetCorrespondingSourceObject: {fileID: 9159787642519714698, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3}
insertIndex: -1
addedObject: {fileID: 1948978143}
m_SourcePrefab: {fileID: 100100000, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3}
--- !u!4 &1948978127 stripped --- !u!4 &1948978127 stripped
Transform: Transform:
@ -86693,6 +86775,18 @@ MonoBehaviour:
m_EditorClassIdentifier: m_EditorClassIdentifier:
color: 1 color: 1
eraseRenderer: 0 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 --- !u!1 &1951452093
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -89167,7 +89261,7 @@ PrefabInstance:
serializedVersion: 2 serializedVersion: 2
m_Modification: m_Modification:
serializedVersion: 3 serializedVersion: 3
m_TransformParent: {fileID: 1408424522} m_TransformParent: {fileID: 1458458471}
m_Modifications: m_Modifications:
- target: {fileID: 6148073173889382962, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3} - target: {fileID: 6148073173889382962, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3}
propertyPath: m_Size.x propertyPath: m_Size.x
@ -89259,6 +89353,9 @@ PrefabInstance:
- targetCorrespondingSourceObject: {fileID: 9159787642519714698, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3} - targetCorrespondingSourceObject: {fileID: 9159787642519714698, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3}
insertIndex: -1 insertIndex: -1
addedObject: {fileID: 2008920496} addedObject: {fileID: 2008920496}
- targetCorrespondingSourceObject: {fileID: 9159787642519714698, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3}
insertIndex: -1
addedObject: {fileID: 2008920499}
m_SourcePrefab: {fileID: 100100000, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3}
--- !u!4 &2008920481 stripped --- !u!4 &2008920481 stripped
Transform: Transform:
@ -89305,6 +89402,18 @@ MonoBehaviour:
m_EditorClassIdentifier: m_EditorClassIdentifier:
color: 1 color: 1
eraseRenderer: 0 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 --- !u!1 &2014946757
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -119986,6 +120095,7 @@ GameObject:
- component: {fileID: 8293918688537252195} - component: {fileID: 8293918688537252195}
- component: {fileID: 8293918688537252196} - component: {fileID: 8293918688537252196}
- component: {fileID: 8293918688537252197} - component: {fileID: 8293918688537252197}
- component: {fileID: 8293918688537252198}
m_Layer: 0 m_Layer: 0
m_Name: car1 m_Name: car1
m_TagString: Car m_TagString: Car
@ -123905,7 +124015,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 1408424522} m_Father: {fileID: 1458458471}
m_LocalEulerAnglesHint: {x: -90, y: 0, z: 90} m_LocalEulerAnglesHint: {x: -90, y: 0, z: 90}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
@ -146766,6 +146876,18 @@ MonoBehaviour:
m_EditorClassIdentifier: m_EditorClassIdentifier:
color: 1 color: 1
eraseRenderer: 0 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 --- !u!1 &8294194876234541303
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

View File

@ -1,4 +1,5 @@
using System; using System;
using System.Collections;
using System.Collections.Concurrent; using System.Collections.Concurrent;
using System.Collections.Generic; using System.Collections.Generic;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
@ -158,7 +159,7 @@ public class MqttManager : MonoSingleton<MqttManager>
} }
} }
} }
public void Carpoint(GameObject car, Carequipment carequipment) public void Carpoint(GameObject car, Carequipment carequipment)
{ {
Debug.Log(carequipment.id); Debug.Log(carequipment.id);
if (car) if (car)
@ -166,9 +167,40 @@ public class MqttManager : MonoSingleton<MqttManager>
Carinformation carbox = car.GetComponent<Carinformation>(); Carinformation carbox = car.GetComponent<Carinformation>();
carbox.BoxCode = carequipment.CarState_BoxCode; carbox.BoxCode = carequipment.CarState_BoxCode;
string point = carequipment.CarState_Car_Column + "-" + carequipment.CarState_Car_Row + "-" + carequipment.CarState_Car_Layer; 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); //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<BoxCollider>();
cars.enabled = true;
}
else if (carequipment.CarState_CarPlt == "下降")
{
//BoxCollider cars = car.GetComponent<BoxCollider>();
//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<BoxCollider>();
cars.enabled = false;
}
} }
} }
/// <summary>
/// 需要位移的地方
/// </summary>
/// <param name="car">小车</param>
/// <param name="dis">位移到指定位置</param>
/// <param name="speed">位移的速度</param>
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);
}
} }

View File

@ -649,6 +649,7 @@ namespace DefaultNamespace
[Serializable] [Serializable]
public class Hoisters public class Hoisters
{ {
public bool isOnline;
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
@ -843,7 +844,7 @@ namespace DefaultNamespace
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public string fauleFree; public string faultFree;
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
@ -1000,6 +1001,7 @@ namespace DefaultNamespace
[Serializable] [Serializable]
public class RPalletizers public class RPalletizers
{ {
public bool isOnline;
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
@ -1218,6 +1220,7 @@ namespace DefaultNamespace
[Serializable] [Serializable]
public class Batterys public class Batterys
{ {
public bool isOnline;
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
@ -1508,6 +1511,10 @@ namespace DefaultNamespace
[Serializable] [Serializable]
public class FeequMessage public class FeequMessage
{ {
/// <summary>
/// 判断是否在线
/// </summary>
public bool isOnline;
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
@ -1744,6 +1751,10 @@ namespace DefaultNamespace
[Serializable] [Serializable]
public class Decappings public class Decappings
{ {
/// <summary>
/// 判断是否在线
/// </summary>
public bool isOnline;
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
@ -1910,6 +1921,10 @@ namespace DefaultNamespace
[Serializable] [Serializable]
public class Conveyordata public class Conveyordata
{ {
/// <summary>
///
/// </summary>
public bool isOnline;
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>

View File

@ -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(); 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")) // if (other.gameObject.CompareTag("Box"))
{ // {
Carinformation car = transform.GetComponent<Carinformation>(); // Carinformation car = transform.GetComponent<Carinformation>();
Boxinformation boxinformation = other.gameObject.transform.GetComponent<Boxinformation>(); // Boxinformation boxinformation = other.gameObject.transform.GetComponent<Boxinformation>();
if (car && boxinformation) // if (car && boxinformation)
{ // {
boxinformation.ID = car.BoxCode; // boxinformation.ID = car.BoxCode;
Debug.Log(boxinformation.ID); // Debug.Log(boxinformation.ID);
} // }
Debug.Log("触发了"); // 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);
//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) // if (other.gameObject != null)
{ // {
// 获取触发器物体的碰撞体 // // 获取触发器物体的碰撞体
Collider triggerCollider = GetComponent<Collider>(); // Collider triggerCollider = GetComponent<Collider>();
// 确保触发器物体有碰撞体 // // 确保触发器物体有碰撞体
if (triggerCollider != null) // if (triggerCollider != null)
{ // {
// 计算触发器物体顶部的世界坐标 // // 计算触发器物体顶部的世界坐标
Vector3 triggerPosition = triggerCollider.bounds.center; // Vector3 triggerPosition = triggerCollider.bounds.center;
Vector3 triggerTop = triggerPosition + Vector3.up * (triggerCollider.bounds.extents.y + -0.2f); // Vector3 triggerTop = triggerPosition + Vector3.up * (triggerCollider.bounds.extents.y + -0.2f);
// 设置物体的位置 // // 设置物体的位置
other.transform.position = triggerTop; // other.transform.position = triggerTop;
other.transform.SetParent(transform); // other.transform.SetParent(transform);
} // }
else // else
{ // {
Debug.LogError("没有碰撞器"); // Debug.LogError("没有碰撞器");
} // }
} // }
else // else
{ // {
Debug.LogError("碰撞到物体了"); // Debug.LogError("碰撞到物体了");
} // }
} // }
} //}
} }

View File

@ -1,3 +1,4 @@
using cakeslice;
using DefaultNamespace; using DefaultNamespace;
using System; using System;
using UnityEngine; 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, 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, "²ÎÊý²»¹»", () => cardata.result.carPLT, cardata.result.error1, cardata.result.error2, cardata.result.error3, cardata.result.error4, cardata.result.error5, "²ÎÊý²»¹»", () =>
{ {
UIDeviceBaseInfoPanel.gameObject.SetActive(false); UIDeviceBaseInfoPanel.gameObject.SetActive(false);
}); });
@ -157,7 +159,7 @@ public class Interaction : MonoBehaviour
} }
if (hit.collider.CompareTag("Hoister")) if (hit.collider.CompareTag("Hoister"))
{ {
Consentmark hoistinformation = hit.collider.gameObject.GetComponent<Consentmark>(); Consentmark hoistinformation = hit.collider.gameObject.GetComponent<Consentmark>();
// Debug.Log(hoistinformation.ID); // Debug.Log(hoistinformation.ID);
string url = Hoisinterface + 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, 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.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.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, () => elevatdata.result.liftAirSwitchFault, elevatdata.result.carRGVInspection2, elevatdata.result.deliveryControllerFault, elevatdata.result.deliveryIsolationSwitchFault, elevatdata.result.liftAirSwitchFault, () =>
{ {
Removeprompt();
UIHoister.gameObject.SetActive(false); UIHoister.gameObject.SetActive(false);
}); });
UIHoister.gameObject.SetActive(true); 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.faultFree, palletizer.result.leftCargoForkExtensionFork, palletizer.result.liftAirSwitchFault, palletizer.result.liftControllerFault,
palletizer.result.leftForkIsolationFault, palletizer.result.rightForkIsolationFault, palletizer.result.liftIsolatingFault, () => palletizer.result.leftForkIsolationFault, palletizer.result.rightForkIsolationFault, palletizer.result.liftIsolatingFault, () =>
{ {
Removeprompt();
UIPalletizer.gameObject.SetActive(false); UIPalletizer.gameObject.SetActive(false);
}); });
UIPalletizer.gameObject.SetActive(true); 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.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, () => batterydata.result.liftAirSwitchFault, batterydata.result.walkControllerFault, batterydata.result.liftControllerFault, batterydata.result.forkExtensionTimeoutFault, batterydata.result.forkRetractionTimeoutFault, () =>
{ {
Removeprompt();
UIReplacebattery.gameObject.SetActive(false); UIReplacebattery.gameObject.SetActive(false);
}); });
UIReplacebattery.gameObject.SetActive(true); 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.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, () => outofthe.result.deviceStatus, outofthe.result.deliveryTimeoutFault, outofthe.result.deliveryAirSwitchFault, outofthe.result.deliveryIsolationSwitchFault, () =>
{ {
Removeprompt();
UIConveyorpanel.gameObject.SetActive(false); UIConveyorpanel.gameObject.SetActive(false);
}); });
UIConveyorpanel.gameObject.SetActive(true); 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.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, () => intothe.result.deviceStatus, intothe.result.deliveryTimeoutFault, intothe.result.deliveryAirSwitchFault, intothe.result.deliveryIsolationSwitchFault, () =>
{ {
Removeprompt();
UIConveyorpanel.gameObject.SetActive(false); UIConveyorpanel.gameObject.SetActive(false);
}); });
UIConveyorpanel.gameObject.SetActive(true); 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.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, () => feequipments.result.lowerLimitFault, feequipments.result.deliveryControllerFault, feequipments.result.deliveryIsolationFault, feequipments.result.deliveryTimeoutFault, feequipments.result.transboundaryFault, () =>
{ {
Removeprompt();
UIFloorelevator.gameObject.SetActive(false); UIFloorelevator.gameObject.SetActive(false);
}); });
UIFloorelevator.gameObject.SetActive(true); 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.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, () => decappingmachine.result.runningIsolationFault, decappingmachine.result.preRunLimitFault, decappingmachine.result.postRunLimitFault, decappingmachine.result.cylinderRiseTimeoutFault, decappingmachine.result.cylinderLoweringTimeoutFault, () =>
{ {
Removeprompt();
UICoverremovalmachine.gameObject.SetActive(false); UICoverremovalmachine.gameObject.SetActive(false);
}); });
UICoverremovalmachine.gameObject.SetActive(true); UICoverremovalmachine.gameObject.SetActive(true);
@ -307,4 +316,15 @@ public class Interaction : MonoBehaviour
} }
} }
} }
/// <summary>
/// ÒƳýÌáʾÁÁ¹â
/// </summary>
private void Removeprompt()
{
if (OutlineEffect.Instance.outlines.Count > 0)
{
OutlineEffect.Instance.outlines.Clear();
}
}
} }

View File

@ -0,0 +1,52 @@
using DG.Tweening;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Loadingoperation : MonoBehaviour
{
/// <summary>
/// 触发上箱操作
/// </summary>
/// <param name="other"></param>
private void OnTriggerEnter(Collider other)
{
if (other.gameObject.CompareTag("Box"))
{
Carinformation car = transform.GetComponent<Carinformation>();
Boxinformation boxinformation = other.gameObject.transform.GetComponent<Boxinformation>();
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<Collider>();
// 确保触发器物体有碰撞体
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("没有获取到物体");
}
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 7edafe89f5afc82419ea88236d9f0557
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -13,6 +13,7 @@ public class Movetest : MonoBehaviour
public Transform targetPosition; public Transform targetPosition;
public float speed = 5; public float speed = 5;
private bool isMoving = true; private bool isMoving = true;
private BoxCollider boxcollider;
void Start() void Start()
{ {
@ -20,7 +21,7 @@ public class Movetest : MonoBehaviour
car1 = GameObject.Find("14-37-2"); car1 = GameObject.Find("14-37-2");
tarton = car1.GetComponent<Transform>(); tarton = car1.GetComponent<Transform>();
boxcollider = transform.GetComponent<BoxCollider>();
_ = Planneddisplacement(); _ = Planneddisplacement();
@ -39,7 +40,9 @@ public class Movetest : MonoBehaviour
Transform point4 = GameObject.Find("13-37-2").transform; 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(); 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; 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(); 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(); 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; 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(); 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(); 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; 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(); 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")) // if (other.gameObject.CompareTag("Box"))
{ // {
Carinformation car = transform.GetComponent<Carinformation>(); // Carinformation car = transform.GetComponent<Carinformation>();
Boxinformation boxinformation = other.gameObject.transform.GetComponent<Boxinformation>(); // Boxinformation boxinformation = other.gameObject.transform.GetComponent<Boxinformation>();
if (car && boxinformation) // if (car && boxinformation)
{ // {
boxinformation.ID = car.BoxCode; // boxinformation.ID = car.BoxCode;
//Debug.Log(boxinformation.ID); // //Debug.Log(boxinformation.ID);
} // }
//Debug.Log("触发了"); // //Debug.Log("触发了");
float pos = other.transform.position.y + 0.3f; // float pos = other.transform.position.y + 0.3f;
other.transform.DOMoveY(pos, 0.3f).SetEase(Ease.InOutQuad); // other.transform.DOMoveY(pos, 0.3f).SetEase(Ease.InOutQuad);
other.transform.SetParent(transform); // other.transform.SetParent(transform);
if (other.gameObject != null) // if (other.gameObject != null)
{ // {
// 获取触发器物体的碰撞体 // // 获取触发器物体的碰撞体
Collider triggerCollider = GetComponent<Collider>(); // Collider triggerCollider = GetComponent<Collider>();
// 确保触发器物体有碰撞体 // // 确保触发器物体有碰撞体
if (triggerCollider != null) // if (triggerCollider != null)
{ // {
// 计算触发器物体顶部的世界坐标 // // 计算触发器物体顶部的世界坐标
Vector3 triggerPosition = triggerCollider.bounds.center; // Vector3 triggerPosition = triggerCollider.bounds.center;
Vector3 triggerTop = triggerPosition + Vector3.up * (triggerCollider.bounds.extents.y + -0.2f); // Vector3 triggerTop = triggerPosition + Vector3.up * (triggerCollider.bounds.extents.y + -0.2f);
// 设置物体的位置 // // 设置物体的位置
other.transform.position = triggerTop; // other.transform.position = triggerTop;
} // }
else // else
{ // {
Debug.LogError("Trigger object does not have a Collider component."); // Debug.LogError("Trigger object does not have a Collider component.");
} // }
} // }
else // else
{ // {
Debug.LogError("Colliding object is not assigned."); // Debug.LogError("Colliding object is not assigned.");
} // }
} // }
} //}
void Update() void Update()
{ {

View File

@ -34,45 +34,45 @@ public class Shippingoffthebox : MonoBehaviour
{ {
} }
private void OnTriggerEnter(Collider other) //private void OnTriggerEnter(Collider other)
{ //{
if (other.gameObject.CompareTag("Box")) // if (other.gameObject.CompareTag("Box"))
{ // {
Carinformation car = transform.GetComponent<Carinformation>(); // Carinformation car = transform.GetComponent<Carinformation>();
Boxinformation boxinformation = other.gameObject.transform.GetComponent<Boxinformation>(); // Boxinformation boxinformation = other.gameObject.transform.GetComponent<Boxinformation>();
if (car && boxinformation) // if (car && boxinformation)
{ // {
boxinformation.ID = car.BoxCode; // boxinformation.ID = car.BoxCode;
//Debug.Log(boxinformation.ID); // //Debug.Log(boxinformation.ID);
} // }
// Debug.Log("触发了"); // // Debug.Log("触发了");
//other.transform.SetParent(transform); // //other.transform.SetParent(transform);
if (other.gameObject != null) // if (other.gameObject != null)
{ // {
// 获取触发器物体的碰撞体 // // 获取触发器物体的碰撞体
Collider triggerCollider = GetComponent<Collider>(); // Collider triggerCollider = GetComponent<Collider>();
// 确保触发器物体有碰撞体 // // 确保触发器物体有碰撞体
if (triggerCollider != null) // if (triggerCollider != null)
{ // {
// 计算触发器物体顶部的世界坐标 // // 计算触发器物体顶部的世界坐标
Vector3 triggerPosition = triggerCollider.bounds.center; // Vector3 triggerPosition = triggerCollider.bounds.center;
Vector3 triggerTop = triggerPosition + Vector3.up * (triggerCollider.bounds.extents.y + -0.2f); // Vector3 triggerTop = triggerPosition + Vector3.up * (triggerCollider.bounds.extents.y + -0.2f);
// 设置物体的位置 // // 设置物体的位置
other.transform.position = triggerTop; // other.transform.position = triggerTop;
other.transform.SetParent(transform); // other.transform.SetParent(transform);
} // }
else // else
{ // {
Debug.LogError("Trigger object does not have a Collider component."); // Debug.LogError("Trigger object does not have a Collider component.");
} // }
} // }
else // else
{ // {
Debug.LogError("Colliding object is not assigned."); // Debug.LogError("Colliding object is not assigned.");
} // }
} // }
} //}
} }

View File

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