Commit d8da639a authored by 潘梓豪's avatar 潘梓豪

更新脚本

parent 9b051ebb
File added
......@@ -16,8 +16,11 @@ public class AGVDemoV2 : MonoBehaviour
public ReportErrorsUI ReportErrorsUI;
public List<string> IsHasError;
private void Start()
{
IsHasError = new List<string>();
StartCoroutine(UpdatePosition());
StartCoroutine(UpdateErrorReporting());
}
......@@ -42,7 +45,7 @@ public class AGVDemoV2 : MonoBehaviour
while (true)
{
UpdateErrorReporting1();
yield return new WaitForSeconds(60);
yield return new WaitForSeconds(5);
}
}
......@@ -55,21 +58,23 @@ public class AGVDemoV2 : MonoBehaviour
{
for (int i = 0; i < facilityManager.Facilitys.Count; i++)
{
if (facilityManager.Facilitys[i].FacilityName == faultData.name)
if (facilityManager.Facilitys[i].FacilityName == faultData.name && (IsHasError.Count<=0 || IsHasError.IndexOf(faultData.name)<0 ))
{
Debug.Log("出现异常"+faultData.name);
IsHasError.Add(faultData.name);
facilityManager.OpenHighlighter(facilityManager.Facilitys[i]);
var ReportErrors = Instantiate(ReportErrorsUI, facilityManager.Facilitys[i].highlight.gameObject.transform);
ReportErrors.DeviceName.text = faultData.name;
ReportErrors.ErrorType.text = faultData.faultDesc;
StartCoroutine(DisableHighlightAfterDelay(facilityManager.Facilitys[i], 300, ReportErrors.gameObject));
StartCoroutine(DisableHighlightAfterDelay(facilityManager.Facilitys[i], 300, ReportErrors.gameObject, faultData.name));
}
}
}
}
}
private IEnumerator DisableHighlightAfterDelay(Facility facility, float delay, GameObject faultIndicator)
private IEnumerator DisableHighlightAfterDelay(Facility facility, float delay, GameObject faultIndicator, string faultDataName)
{
yield return new WaitForSeconds(delay);
facilityManager.CloseHighlighter(facility);
......@@ -79,5 +84,9 @@ public class AGVDemoV2 : MonoBehaviour
{
Destroy(faultIndicator);
}
if (IsHasError!=null && IsHasError.Count>0)
{
IsHasError.Remove(faultDataName);
}
}
}
......@@ -21,11 +21,18 @@ public class CollisionRotation : MonoBehaviour
{
if (IsRobotInspection1)
{
virtualCamera = touristModeController.CameraInspection1.GetComponent<CinemachineVirtualCamera>();
if (touristModeController.CameraInspection1!=null)
{
virtualCamera = touristModeController.CameraInspection1.GetComponent<CinemachineVirtualCamera>();
}
}
else
{
virtualCamera = touristModeController.CameraInspection2.GetComponent<CinemachineVirtualCamera>();
if (touristModeController.CameraInspection2 != null)
{
virtualCamera = touristModeController.CameraInspection2.GetComponent<CinemachineVirtualCamera>();
}
}
}
if (other.name == CollisionObjectName)
......
......@@ -103,7 +103,7 @@ MonoBehaviour:
m_PrefilterSSAOSampleCountHigh: 1
m_PrefilterDBufferMRT1: 1
m_PrefilterDBufferMRT2: 1
m_PrefilterDBufferMRT3: 0
m_PrefilterDBufferMRT3: 1
m_PrefilterSoftShadowsQualityLow: 1
m_PrefilterSoftShadowsQualityMedium: 1
m_PrefilterSoftShadowsQualityHigh: 1
......
......@@ -103,7 +103,7 @@ MonoBehaviour:
m_PrefilterSSAOSampleCountHigh: 0
m_PrefilterDBufferMRT1: 1
m_PrefilterDBufferMRT2: 1
m_PrefilterDBufferMRT3: 0
m_PrefilterDBufferMRT3: 1
m_PrefilterSoftShadowsQualityLow: 1
m_PrefilterSoftShadowsQualityMedium: 1
m_PrefilterSoftShadowsQualityHigh: 1
......
......@@ -11101,6 +11101,7 @@ MonoBehaviour:
AGVName: AGV2
ReportErrorsUI: {fileID: 9113711836560366625, guid: 2a25391e5be82954881b4276687dc048,
type: 3}
IsHasError: []
--- !u!114 &346303891
MonoBehaviour:
m_ObjectHideFlags: 0
......@@ -13678,6 +13679,7 @@ MonoBehaviour:
AGVName: AGV1
ReportErrorsUI: {fileID: 9113711836560366625, guid: 2a25391e5be82954881b4276687dc048,
type: 3}
IsHasError: []
--- !u!114 &560685328
MonoBehaviour:
m_ObjectHideFlags: 0
......@@ -18718,7 +18720,7 @@ PrefabInstance:
- target: {fileID: 3618798332614272892, guid: 72c6cc24197ee2747bcb13d5cf8e28c3,
type: 3}
propertyPath: m_IsActive
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3618798332614272893, guid: 72c6cc24197ee2747bcb13d5cf8e28c3,
type: 3}
......@@ -18853,22 +18855,22 @@ PrefabInstance:
- target: {fileID: 3618798334079683222, guid: 72c6cc24197ee2747bcb13d5cf8e28c3,
type: 3}
propertyPath: m_AnchorMax.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3618798334079683222, guid: 72c6cc24197ee2747bcb13d5cf8e28c3,
type: 3}
propertyPath: m_AnchorMin.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3618798334079683222, guid: 72c6cc24197ee2747bcb13d5cf8e28c3,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 477
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3618798334079683222, guid: 72c6cc24197ee2747bcb13d5cf8e28c3,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -306.34998
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3618798334079683223, guid: 72c6cc24197ee2747bcb13d5cf8e28c3,
type: 3}
......@@ -18918,22 +18920,22 @@ PrefabInstance:
- target: {fileID: 3618798334575208420, guid: 72c6cc24197ee2747bcb13d5cf8e28c3,
type: 3}
propertyPath: m_AnchorMax.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3618798334575208420, guid: 72c6cc24197ee2747bcb13d5cf8e28c3,
type: 3}
propertyPath: m_AnchorMin.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3618798334575208420, guid: 72c6cc24197ee2747bcb13d5cf8e28c3,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 105
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3618798334575208420, guid: 72c6cc24197ee2747bcb13d5cf8e28c3,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -306.34998
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3618798334575208421, guid: 72c6cc24197ee2747bcb13d5cf8e28c3,
type: 3}
......@@ -18953,42 +18955,42 @@ PrefabInstance:
- target: {fileID: 3992369889955778430, guid: 72c6cc24197ee2747bcb13d5cf8e28c3,
type: 3}
propertyPath: m_AnchorMax.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3992369889955778430, guid: 72c6cc24197ee2747bcb13d5cf8e28c3,
type: 3}
propertyPath: m_AnchorMin.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3992369889955778430, guid: 72c6cc24197ee2747bcb13d5cf8e28c3,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 291
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3992369889955778430, guid: 72c6cc24197ee2747bcb13d5cf8e28c3,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -306.34998
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4392102991719277207, guid: 72c6cc24197ee2747bcb13d5cf8e28c3,
type: 3}
propertyPath: m_AnchorMax.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4392102991719277207, guid: 72c6cc24197ee2747bcb13d5cf8e28c3,
type: 3}
propertyPath: m_AnchorMin.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4392102991719277207, guid: 72c6cc24197ee2747bcb13d5cf8e28c3,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 18
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4392102991719277207, guid: 72c6cc24197ee2747bcb13d5cf8e28c3,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -30
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4472384063604010404, guid: 72c6cc24197ee2747bcb13d5cf8e28c3,
type: 3}
......@@ -19045,22 +19047,22 @@ PrefabInstance:
- target: {fileID: 6362739256838486730, guid: 72c6cc24197ee2747bcb13d5cf8e28c3,
type: 3}
propertyPath: m_AnchorMax.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6362739256838486730, guid: 72c6cc24197ee2747bcb13d5cf8e28c3,
type: 3}
propertyPath: m_AnchorMin.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6362739256838486730, guid: 72c6cc24197ee2747bcb13d5cf8e28c3,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 663
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6362739256838486730, guid: 72c6cc24197ee2747bcb13d5cf8e28c3,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -306.34998
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6459680320303193160, guid: 72c6cc24197ee2747bcb13d5cf8e28c3,
type: 3}
......@@ -22294,7 +22296,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &1371736656
RectTransform:
m_ObjectHideFlags: 0
......@@ -37137,7 +37139,7 @@ PrefabInstance:
- target: {fileID: 1808383340561177724, guid: e525963e80d07df418ccdd194c29ff2a,
type: 3}
propertyPath: m_LocalPosition.x
value: -5.62
value: 5.35
objectReference: {fileID: 0}
- target: {fileID: 1808383340561177724, guid: e525963e80d07df418ccdd194c29ff2a,
type: 3}
......@@ -37147,22 +37149,22 @@ PrefabInstance:
- target: {fileID: 1808383340561177724, guid: e525963e80d07df418ccdd194c29ff2a,
type: 3}
propertyPath: m_LocalRotation.w
value: 0.6963643
value: -0.7595737
objectReference: {fileID: 0}
- target: {fileID: 1808383340561177724, guid: e525963e80d07df418ccdd194c29ff2a,
type: 3}
propertyPath: m_LocalRotation.x
value: 0.12278779
value: -0.13393332
objectReference: {fileID: 0}
- target: {fileID: 1808383340561177724, guid: e525963e80d07df418ccdd194c29ff2a,
type: 3}
propertyPath: m_LocalRotation.y
value: -0.6963643
value: -0.6268127
objectReference: {fileID: 0}
- target: {fileID: 1808383340561177724, guid: e525963e80d07df418ccdd194c29ff2a,
type: 3}
propertyPath: m_LocalRotation.z
value: 0.12278779
value: 0.110523984
objectReference: {fileID: 0}
- target: {fileID: 1808383340561177724, guid: e525963e80d07df418ccdd194c29ff2a,
type: 3}
......@@ -37172,12 +37174,12 @@ PrefabInstance:
- target: {fileID: 1808383340561177724, guid: e525963e80d07df418ccdd194c29ff2a,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: -90
value: -280.94
objectReference: {fileID: 0}
- target: {fileID: 3808107295801017191, guid: e525963e80d07df418ccdd194c29ff2a,
type: 3}
propertyPath: m_LocalPosition.x
value: 51.861004
value: -51.08637
objectReference: {fileID: 0}
- target: {fileID: 3808107295801017191, guid: e525963e80d07df418ccdd194c29ff2a,
type: 3}
......@@ -37187,27 +37189,27 @@ PrefabInstance:
- target: {fileID: 3808107295801017191, guid: e525963e80d07df418ccdd194c29ff2a,
type: 3}
propertyPath: m_LocalPosition.z
value: -3.4999924
value: -14.408779
objectReference: {fileID: 0}
- target: {fileID: 3808107295801017191, guid: e525963e80d07df418ccdd194c29ff2a,
type: 3}
propertyPath: m_LocalRotation.w
value: 0.6963643
value: -0.7595737
objectReference: {fileID: 0}
- target: {fileID: 3808107295801017191, guid: e525963e80d07df418ccdd194c29ff2a,
type: 3}
propertyPath: m_LocalRotation.x
value: 0.12278779
value: -0.13393332
objectReference: {fileID: 0}
- target: {fileID: 3808107295801017191, guid: e525963e80d07df418ccdd194c29ff2a,
type: 3}
propertyPath: m_LocalRotation.y
value: -0.6963643
value: -0.6268127
objectReference: {fileID: 0}
- target: {fileID: 3808107295801017191, guid: e525963e80d07df418ccdd194c29ff2a,
type: 3}
propertyPath: m_LocalRotation.z
value: 0.12278779
value: 0.110523984
objectReference: {fileID: 0}
- target: {fileID: 4011120318709446473, guid: e525963e80d07df418ccdd194c29ff2a,
type: 3}
......@@ -37227,7 +37229,7 @@ PrefabInstance:
- target: {fileID: 5222297752785051951, guid: e525963e80d07df418ccdd194c29ff2a,
type: 3}
propertyPath: AutoRotate
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5222297752785051951, guid: e525963e80d07df418ccdd194c29ff2a,
type: 3}
......@@ -5,7 +5,7 @@ EditorBuildSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Scenes:
- enabled: 0
- enabled: 1
path: Assets/_Scenes/1_Main.unity
guid: a1193329f89803b4f8a14f6c0b15d2c1
- enabled: 0
......@@ -17,7 +17,7 @@ EditorBuildSettings:
- enabled: 0
path: Assets/_Scenes/1_MainScene.unity
guid: e4c39eb47535a384593b511e167b172c
- enabled: 1
- enabled: 0
path: Assets/_Scenes/CollectData.unity
guid: 7cb79544f5cf7bb41afc6ff81fa0afd7
m_configObjects:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment