巡檢
程式碼
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using DG.Tweening;
using UnityEngine.SceneManagement;
using UnityStandardAssets.Characters.FirstPerson;
namespace ElectricPower.WindPower
{
public class InspectionPart2 : MonoBehaviour
{
public static InspectionPart2 inspectionpart2;
public FirstPersonController firstpersonController;//第一人稱控制
[SerializeField] private HighLightObjectManager thisHighLight;
public Camera myCamera;//第一人稱視角攝像機
public Transform FPSCameraTran;
public GameObject[] Panel_Tips;//巡檢內容面板物件(小提示,概括提示,詳細操作提示,下一階段重新開始)
public GameObject Greeting_bg;
public GameObject Greeting_tips;//問好提示物件
public GameObject ColliderObj;//碰撞體物件
public GameObject[] Gobutton;//跳點按鈕物件
public Image Greeting_tipsImg;//提示問好圖片
public Text[] ContentText;//內容文字提示(0:概括總覽提示1:詳細操作內容提示2:第一步小提示3:巡檢結束)
private float CurrentTime = 0;//當前時間
public bool[] isOpen;//射線碰到對應的帶標籤的物體開啟
public bool[] isTrigger;//射線檢測僅此一次觸發
public bool[] isNextStep;//具體提示下一步判斷
public bool[] isNextModular;//大的模組判斷
private bool FinishPart3;//是否結束外體預應力束
private bool FinishPart2;//是否風輪基礎及塔筒和塔筒內部檢查
public bool IsStartTrigger;
public bool guodu2=false;
[Header("巡檢圖片")]
[SerializeField] private Image[] thisImages;
[SerializeField] private Sprite[] thisSpriteRight;
[SerializeField] private Sprite[] thisSpriteWrong;
private bool isRight;//判斷是否為好的
void Start() { inspectionpart2 = this; firstpersonController.enabled = false;//關閉禁用人物運動指令碼 Greeting_tips.SetActive(true); ColliderObj.SetActive(true); thisHighLight.OnObject(2);//開始高亮的物體 } void Update() { if (true) { InspectionMananger._instance.InspectionAndRadiographic(); if (isOpen[1]) { Panel_Tips[0].SetActive(false); TipsContent(1); NoActiveGoButton(); } if (isOpen[2]) { Panel_Tips[0].SetActive(false); TipsContent(2); NoActiveGoButton(); } if (isOpen[3]) { Panel_Tips[0].SetActive(false); TipsContent(3); NoActiveGoButton(); } if (isOpen[4]) { Panel_Tips[0].SetActive(false); TipsContent(4); NoActiveGoButton(); } if (isOpen[5]) { Panel_Tips[0].SetActive(false); TipsContent(5); NoActiveGoButton(); } if (isOpen[6]) { Panel_Tips[0].SetActive(false); TipsContent(6); NoActiveGoButton(); } if (isOpen[7]) { Panel_Tips[0].SetActive(false); TipsContent(7); NoActiveGoButton(); } if (isOpen[8]) { Panel_Tips[0].SetActive(false); TipsContent(8); NoActiveGoButton(); } if (isOpen[9]) { Panel_Tips[0].SetActive(false); TipsContent(9); NoActiveGoButton(); } if (isOpen[10]) { Panel_Tips[0].SetActive(false); TipsContent(10); NoActiveGoButton(); } } } //點選按鈕去地面 public void GoGround() { InspectionMananger._instance.InspectionAndRadiographic(); InspectionMananger._instance.thisInspection = EnumManager.TowerInsideInspection.Ground; Panel_Tips[0].SetActive(true); ContentText[2].text = "提示:風機基礎及塔筒和塔筒內部檢查"; thisHighLight.OnObject(2);//開始高亮的物體 isTrigger[1] = true;isTrigger[2] = false; isTrigger[3] = false; isTrigger[4] = false; isTrigger[5] = false; isTrigger[6] = false; isTrigger[7] = false; isTrigger[8] = false; isTrigger[9] = false; isNextModular[1] = true; isNextModular[2] = false; isNextModular[3] = false; isNextModular[4] = false; isNextModular[5] = false; isNextModular[6] = false; isNextModular[7] = false; isNextModular[8] = false; isNextModular[9] = false; for(int i = 0; i < 8; i++) { Gobutton[i].GetComponent<Button>().interactable = false; } } //點選按鈕去塔內平臺0 public void GoPlant0() { InspectionMananger._instance.InspectionAndRadiographic(); InspectionMananger._instance.thisInspection = EnumManager.TowerInsideInspection.Plant0; thisHighLight.OnObject(3);//平臺1高亮 IsStartTrigger = true; isTrigger[1] = false; isTrigger[2] = false; isTrigger[3] = true; isTrigger[4] = false; isTrigger[5] = false; isTrigger[6] = false; isTrigger[7] = false; isTrigger[8] = false; isTrigger[9] = false; isNextModular[1] = false; isNextModular[2] = false; isNextModular[3] = true; isNextModular[4] = false; isNextModular[5] = false; isNextModular[6] = false; isNextModular[7] = false; isNextModular[8] = false; isNextModular[9] = false; for (int i = 0; i < 8; i++) { Gobutton[i].GetComponent<Button>().interactable = false; } } //點選按鈕去塔內平臺1 public void GoPlant1() { InspectionMananger._instance.InspectionAndRadiographic(); InspectionMananger._instance.thisInspection = EnumManager.TowerInsideInspection.dianqigui_dankaimen; thisHighLight.OnObject(4);//電氣櫃高亮 IsStartTrigger = true; isTrigger[1] = false; isTrigger[2] = false; isTrigger[3] = false; isTrigger[4] = true; isTrigger[5] = false; isTrigger[6] = false; isTrigger[7] = false; isTrigger[8] = false; isTrigger[9] = false; isNextModular[1] = false; isNextModular[2] = false; isNextModular[3] = false; isNextModular[4] = true; isNextModular[5] = false; isNextModular[6] = false; isNextModular[7] = false; isNextModular[8] = false; isNextModular[9] = false; for (int i = 0; i < 8; i++) { Gobutton[i].GetComponent<Button>().interactable = false; } } //點選去塔內平臺2 public void GoPlant2() { InspectionMananger._instance.InspectionAndRadiographic(); InspectionMananger._instance.thisInspection = EnumManager.TowerInsideInspection.DianTi; thisHighLight.OnObject(5);//平臺1高亮 IsStartTrigger = true; isTrigger[1] = false; isTrigger[2] = false; isTrigger[3] = false; isTrigger[4] = false; isTrigger[5] = true; isTrigger[6] = false; isTrigger[7] = false; isTrigger[8] = false; isTrigger[9] = false; isNextModular[1] = false; isNextModular[2] = false; isNextModular[3] = false; isNextModular[4] = false; isNextModular[5] = true; isNextModular[6] = false; isNextModular[7] = false; isNextModular[8] = false; isNextModular[9] = false; for (int i = 0; i < 8; i++) { Gobutton[i].GetComponent<Button>().interactable = false; } } //點選按鈕去塔內平臺3 public void GoPlant3() { InspectionMananger._instance.InspectionAndRadiographic(); InspectionMananger._instance.thisInspection = EnumManager.TowerInsideInspection.pingtai3_point; thisHighLight.OnObject(6);//平臺1高亮 IsStartTrigger = true; isTrigger[1] = false; isTrigger[2] = false; isTrigger[3] = false; isTrigger[4] = false; isTrigger[5] = false; isTrigger[6] = true; isTrigger[7] = false; isTrigger[8] = false; isTrigger[9] = false; isNextModular[1] = false; isNextModular[2] = false; isNextModular[3] = false; isNextModular[4] = false; isNextModular[5] = false; isNextModular[6] = true; isNextModular[7] = false; isNextModular[8] = false; isNextModular[9] = false; for (int i = 0; i < 8; i++) { Gobutton[i].GetComponent<Button>().interactable = false; } } //點選按鈕去塔內平臺4 public void GoPlant4() { InspectionMananger._instance.InspectionAndRadiographic(); InspectionMananger._instance.thisInspection = EnumManager.TowerInsideInspection.pingtai4_point; thisHighLight.OnObject(7);//平臺1高亮 IsStartTrigger = true; isTrigger[1] = false; isTrigger[2] = false; isTrigger[3] = false; isTrigger[4] = false; isTrigger[5] = false; isTrigger[6] = false; isTrigger[7] = true; isTrigger[8] = false; isTrigger[9] = false; isNextModular[1] = false; isNextModular[2] = false; isNextModular[3] = false; isNextModular[4] = false; isNextModular[5] = false; isNextModular[6] = false; isNextModular[7] = true; isNextModular[8] = false; isNextModular[9] = false; for (int i = 0; i < 8; i++) { Gobutton[i].GetComponent<Button>().interactable = false; } } //點選按鈕去塔內平臺5 public void GoPlant5() { InspectionMananger._instance.InspectionAndRadiographic(); InspectionMananger._instance.thisInspection = EnumManager.TowerInsideInspection.pingtai5_point; thisHighLight.OnObject(8);//平臺1高亮 IsStartTrigger = true; isTrigger[1] = false; isTrigger[2] = false; isTrigger[3] = false; isTrigger[4] = false; isTrigger[5] = false; isTrigger[6] = false; isTrigger[7] = false; isTrigger[8] = true; isTrigger[9] = false; isNextModular[1] = false; isNextModular[2] = false; isNextModular[3] = false; isNextModular[4] = false; isNextModular[5] = false; isNextModular[6] = false; isNextModular[7] = false; isNextModular[8] = true; isNextModular[9] = false; for (int i = 0; i < 8; i++) { Gobutton[i].GetComponent<Button>().interactable = false; } } //點選按鈕去塔內平臺6 public void GoPlant6() { InspectionMananger._instance.InspectionAndRadiographic(); InspectionMananger._instance.thisInspection = EnumManager.TowerInsideInspection.pingtai6_point; thisHighLight.OnObject(9);//平臺1高亮 IsStartTrigger = true; isTrigger[1] = false; isTrigger[2] = false; isTrigger[3] = false; isTrigger[4] = false; isTrigger[5] = false; isTrigger[6] = false; isTrigger[7] = false; isTrigger[8] = false; isTrigger[9] = true; isNextModular[1] = false; isNextModular[2] = false; isNextModular[3] = false; isNextModular[4] = false; isNextModular[5] = false; isNextModular[6] = false; isNextModular[7] = false; isNextModular[8] = false; isNextModular[9] = true; for (int i = 0; i < 8; i++) { Gobutton[i].GetComponent<Button>().interactable = false; } } //啟用平臺點選按鈕 public void ActiveGoButton() { for (int i = 0; i < 8; i++) { Gobutton[i].GetComponent<Button>().interactable = true; } } //不啟用平臺點選按鈕 public void NoActiveGoButton() { for (int i = 0; i < 8; i++) { Gobutton[i].GetComponent<Button>().interactable = false; } } //提示內容 public void TipsContent(int num) { Greeting_bg.SetActive(true); CurrentTime += Time.deltaTime * 0.5f; Greeting_tipsImg.fillAmount = CurrentTime; if (Greeting_tipsImg.fillAmount == 1) { CurrentTime = 0; Greeting_tipsImg.fillAmount = 0; Greeting_bg.SetActive(false); isOpen[num] = false; Panel_Tips[1].SetActive(true); ContentTip(num); } } //巡視內容 public void ContentTip(int num) { if (num == 1) { ContentText[0].text = "1.檢查基礎混凝土是否存在裂痕,若存在,是否小於0.2mm。" + "\n" + "\n" + "2.檢查基礎混凝土無風化。" + "\n" + "\n" + "3.檢查基礎及周邊無沉降,周圍泥土無過高或缺少。" + "\n" + "\n" + "4.基礎周圍無雨水沖刷所成溝壑。"; } if (num == 2) { ContentText[0].text = "1.檢查塔筒門鎖閉系統無鏽蝕、損壞。" + "\n" + "\n" + "2.檢查塔筒門密封面接觸良好。" + "\n" + "\n" + "3.檢查塔筒門防腐塗層無破損、掉漆。" + "\n" + "\n" + "4.檢查塔筒門合頁潤滑良好。"; } if (num == 3) { ContentText[0].text = "1.檢查基礎環各接地線齊全,各部位接觸良好,無鬆動、嚴重鏽蝕現象。" + "\n" + "\n" + "2.檢查塔基底部乾燥無積水。" + "\n" + "\n" + "3.檢查塔基底部環網櫃出線電纜的電纜孔防水封堵良好,無滲漏水痕跡。"+"\n"+"\n"+"4.檢查塔基控制器液晶顯示屏顯示內容正確,各畫面切換正常。" + "\n" + "\n" + "5.檢查塔基控制器各訊號燈指示正確。"; } if (num == 4) { ContentText[0].text = "1.檢查塔基控制櫃安裝牢固,無鬆動及異常震動現象。" + "\n" + "\n" + "2.檢查塔基控制櫃所有開關、繼電器、熔斷器、電纜等部件應完好。" + "\n" + "\n" + "3.檢查底塔控制櫃加熱器投退正常。" + "\n" + "\n" + "4.檢查塔基控制櫃內各接線處無鬆動、過熱、放電現象。" + "\n" + "\n" + "5.檢查塔基控制櫃上急停按鈕完好,位置正確。"; } if (num == 5) { ContentText[0].text = "1.檢查各平臺蓋板安裝牢固,無鬆動、移位、缺失現象。" + "\n" + "\n" + "2.檢查塔底平臺各電纜應完好,無破損和絕緣老化現象。" + "\n" + "\n" + "3.檢查轉接環與鋼塔筒連線螺栓齊全,按規定力矩標準緊固,無鬆動、脫落現象。" + "\n" + "\n" + "4.檢查滅火器數量及壓力正常。"; } if (num == 6) { ContentText[0].text = "1.檢查筒爬梯完好,爬梯及爬梯與塔筒壁連線部分螺栓無鬆動、脫落現象,焊接部分無裂紋、開焊現象。安全繩緊固完好。" + "\n" + "\n" + "2.檢查塔筒內部照明系統(正常照明和應急照明)良好,燈具無破損現象,亮度符合要求。" + "\n" + "\n" + "3.檢查各節塔筒連線處接地線齊全,各部位接觸良好,無鬆動、嚴重鏽蝕現象。" + "\n" + "\n" + "4.檢查各節塔筒連線處螺栓齊全,無鬆動、鏽蝕、脫落現象,力矩線無偏移。"; } if (num == 7) { ContentText[0].text = "1.檢查塔筒內各平臺吊物孔蓋板可靠蓋好,護欄應完好。" + "\n" + "\n" + "2.檢查塔筒內電纜完好,無下墜、異常扭曲現象,電纜夾子無鬆動現象。" + "\n" + "\n" + "3.檢查塔筒各平臺衛生合格、無滲漏油積存。" + "\n" + "\n" + "4.檢查塔筒內各焊縫和加強結構部位是否有損傷。" + "\n" + "\n" + "5.檢查塔筒內各平臺電纜封堵良好。"; } if (num == 8) { ContentText[0].text = "1.塔筒各焊縫外觀正常。" + "\n" + "\n" + "2.扭纜鋼絲吊網正常。"; } if (num == 9) { ContentText[0].text = "1.檢查每段混塔之間外露灌漿面的密封可靠,並做防水處理。" + "\n" + "\n" + "2.檢查每段混塔之間外露灌漿面是否存在裂縫,若存在,是否小於0.2mm。" + "\n" + "\n" + "3.檢查轉接環外露灌漿面的密封可靠,並做防水處理。" + "\n"+"\n"+ "4.檢查轉接環頂部、底部、內弧面是否存在裂縫,若存在,是否小於0.2mm。"; } if (num == 10) { ContentText[0].text = "1.檢查鋼絞線束自由段,沒有和塔壁及其它物體意外接觸的跡象。" + "\n" + "\n" + "2.檢查所有金屬部件沒有生鏽。" + "\n" + "\n" + "3.檢查所有部件沒有機械或其它損傷。" + "\n" + "\n" + "4.使用手電筒檢測下面預埋管內部,不應有水分,鋼絞線束接觸管壁,未發生磨損,機械損傷,毛刺等現象。"; } } public void ContentStep(int number) { if (isNextModular[1]) { thisImages[0].gameObject.SetActive(true); thisImages[1].gameObject.SetActive(true); if (number == 0) { ContentText[1].text = "1.檢查基礎混凝土是否存在裂痕,若存在,是否小於0.2mm"; thisImages[0].sprite = thisSpriteRight[0]; thisImages[1].sprite = thisSpriteWrong[0]; } if (number == 1) { ContentText[1].text = "2.檢查基礎混凝土無風化"; thisImages[0].sprite = thisSpriteRight[1]; thisImages[1].sprite = thisSpriteWrong[1]; } if (number == 2) { ContentText[1].text = "3.檢查基礎及周邊無沉降,周圍泥土無過高或缺少"; thisImages[0].sprite = thisSpriteRight[2]; thisImages[1].sprite = thisSpriteWrong[2]; } if (number == 3) { ContentText[1].text = "4.基礎周圍無雨水沖刷所成溝壑"; thisImages[0].sprite = thisSpriteRight[3]; thisImages[1].sprite = thisSpriteWrong[3]; } } if (isNextModular[2]) { thisImages[0].gameObject.SetActive(true); thisImages[1].gameObject.SetActive(true); if (number == 0) { ContentText[1].text = "1.檢查塔筒門鎖閉系統無鏽蝕、損壞"; thisImages[0].sprite = thisSpriteRight[4]; thisImages[1].sprite = thisSpriteWrong[4]; } if (number == 1) { ContentText[1].text = "2.檢查塔筒門密封面接觸良好"; thisImages[0].sprite = thisSpriteRight[5]; thisImages[1].sprite = thisSpriteWrong[5]; } if (number == 2) { ContentText[1].text = "3.檢查塔筒門防腐塗層無破損、掉漆"; thisImages[0].sprite = thisSpriteRight[6]; thisImages[1].sprite = thisSpriteWrong[6]; } if (number == 3) { ContentText[1].text = "4.檢查塔筒門合頁潤滑良好"; thisImages[0].sprite = thisSpriteRight[7]; thisImages[1].sprite = thisSpriteWrong[7]; } } if (isNextModular[3]) { thisImages[0].gameObject.SetActive(true); thisImages[1].gameObject.SetActive(true); if (number == 0) { ContentText[4].text = "1.檢查基礎環各接地線齊全,各部位接觸良好,無鬆動、嚴重鏽蝕現象"; thisImages[0].sprite = thisSpriteRight[8]; thisImages[1].sprite = thisSpriteWrong[8]; } if (number == 1) { ContentText[4].text = "2.檢查塔基底部乾燥無積水"; thisImages[0].sprite = thisSpriteRight[9]; thisImages[1].sprite = thisSpriteWrong[9]; } if (number == 2) { ContentText[4].text = "3.檢查塔基底部環網櫃出線電纜的電纜孔防水封堵良好,無滲漏水痕跡"; thisImages[0].sprite = thisSpriteRight[10]; thisImages[1].sprite = thisSpriteWrong[10]; } if (number == 3) { ContentText[4].text = "4.檢查塔基控制器液晶顯示屏顯示內容正確,各畫面切換正常"; thisImages[0].sprite = thisSpriteRight[11]; thisImages[1].sprite = thisSpriteWrong[11]; } if (number == 4) { ContentText[4].text = "5.檢查塔基控制器各訊號燈指示正確"; thisImages[0].sprite = thisSpriteRight[12]; thisImages[1].sprite = thisSpriteWrong[12]; } } if (isNextModular[4]) { thisImages[0].gameObject.SetActive(true); thisImages[1].gameObject.SetActive(true); if (number == 0) { ContentText[4].text = "1.檢查塔基控制櫃安裝牢固,無鬆動及異常震動現象"; thisImages[0].sprite = thisSpriteRight[13]; thisImages[1].sprite = thisSpriteWrong[13]; } if (number == 1) { ContentText[4].text = "2.檢查塔基控制櫃所有開關、繼電器、熔斷器、電纜等部件應完好"; thisImages[0].sprite = thisSpriteRight[14]; thisImages[1].sprite = thisSpriteWrong[14]; } if (number == 2) { ContentText[4].text = "3.檢查底塔控制櫃加熱器投退正常"; thisImages[0].sprite = thisSpriteRight[15]; thisImages[1].sprite = thisSpriteWrong[15]; } if (number == 3) { ContentText[4].text = "4.檢查塔基控制櫃內各接線處無鬆動、過熱、放電現象"; thisImages[0].sprite = thisSpriteRight[16]; thisImages[1].sprite = thisSpriteWrong[16]; } if (number == 4) { ContentText[4].text = "5.檢查塔基控制櫃上急停按鈕完好,位置正確"; thisImages[0].sprite = thisSpriteRight[17]; thisImages[1].sprite = thisSpriteWrong[17]; } } if (isNextModular[5]) { thisImages[0].gameObject.SetActive(true); thisImages[1].gameObject.SetActive(true); if (number == 0) { ContentText[1].text = "1.檢查各平臺蓋板安裝牢固,無鬆動、移位、缺失現象"; thisImages[0].sprite = thisSpriteRight[18]; thisImages[1].sprite = thisSpriteWrong[18]; } if (number == 1) { ContentText[1].text = "2.檢查塔底平臺各電纜應完好,無破損和絕緣老化現象"; thisImages[0].sprite = thisSpriteRight[19]; thisImages[1].sprite = thisSpriteWrong[19]; } if (number == 2) { ContentText[1].text = "3.檢查轉接環與鋼塔筒連線螺栓齊全,按規定力矩標準緊固,無鬆動、脫落現象"; thisImages[0].sprite = thisSpriteRight[20]; thisImages[1].sprite = thisSpriteWrong[20]; } if (number == 3) { ContentText[1].text = "4.檢查滅火器數量及壓力正常"; thisImages[0].sprite = thisSpriteRight[21]; thisImages[1].sprite = thisSpriteWrong[21]; } } if (isNextModular[6]) { thisImages[0].gameObject.SetActive(true); thisImages[1].gameObject.SetActive(true); if (number == 0) { ContentText[1].text = "1.檢查筒爬梯完好,爬梯及爬梯與塔筒壁連線部分螺栓無鬆動、脫落現象,焊接部分無裂紋、開焊現象。安全繩緊固完好"; thisImages[0].sprite = thisSpriteRight[22]; thisImages[1].sprite = thisSpriteWrong[22]; } if (number == 1) { ContentText[1].text = "2.檢查塔筒內部照明系統(正常照明和應急照明)良好,燈具無破損現象,亮度符合要求"; thisImages[0].sprite = thisSpriteRight[23]; thisImages[1].sprite = thisSpriteWrong[23]; } if (number == 2) { ContentText[1].text = "3.檢查各節塔筒連線處接地線齊全,各部位接觸良好,無鬆動、嚴重鏽蝕現象"; thisImages[0].sprite = thisSpriteRight[24]; thisImages[1].sprite = thisSpriteWrong[24]; } if (number == 3) { ContentText[1].text = "4.檢查各節塔筒連線處螺栓齊全,無鬆動、鏽蝕、脫落現象,力矩線無偏移"; thisImages[0].sprite = thisSpriteRight[25]; thisImages[1].sprite = thisSpriteWrong[25]; } } if (isNextModular[7]) { thisImages[0].gameObject.SetActive(true); thisImages[1].gameObject.SetActive(true); if (number == 0) { ContentText[4].text = "1.檢查塔筒內各平臺吊物孔蓋板可靠蓋好,護欄應完好"; thisImages[0].sprite = thisSpriteRight[26]; thisImages[1].sprite = thisSpriteWrong[26]; } if (number == 1) { ContentText[4].text = "2.檢查塔筒內電纜完好,無下墜、異常扭曲現象,電纜夾子無鬆動現象"; thisImages[0].sprite = thisSpriteRight[27]; thisImages[1].sprite = thisSpriteWrong[27]; } if (number == 2) { ContentText[4].text = "3.檢查塔筒各平臺衛生合格、無滲漏油積存"; thisImages[0].sprite = thisSpriteRight[28]; thisImages[1].sprite = thisSpriteWrong[28]; } if (number == 3) { ContentText[4].text = "4.檢查塔筒內各焊縫和加強結構部位是否有損傷"; thisImages[0].sprite = thisSpriteRight[29]; thisImages[1].sprite = thisSpriteWrong[29]; } if (number == 4) { ContentText[4].text = "5.檢查塔筒內各平臺電纜封堵良好"; thisImages[0].sprite = thisSpriteRight[30]; thisImages[1].sprite = thisSpriteWrong[30]; } } if (isNextModular[8]) { thisImages[0].gameObject.SetActive(true); thisImages[1].gameObject.SetActive(true); if (number == 0) { ContentText[5].text = "1.塔筒各焊縫外觀正常"; thisImages[0].sprite = thisSpriteRight[31]; thisImages[1].sprite = thisSpriteWrong[31]; } if (number == 1) { ContentText[5].text = "2.扭纜鋼絲吊網正常"; thisImages[0].sprite = thisSpriteRight[32]; thisImages[1].sprite = thisSpriteWrong[32]; } } if (isNextModular[9]) { thisImages[0].gameObject.SetActive(true); thisImages[1].gameObject.SetActive(true); if (number == 0) { ContentText[1].text = "1.檢查每段混塔之間外露灌漿面的密封可靠,並做防水處理"; thisImages[0].sprite = thisSpriteRight[33]; thisImages[1].sprite = thisSpriteWrong[33]; } if (number == 1) { ContentText[1].text = "2.檢查每段混塔之間外露灌漿面是否存在裂縫,若存在,是否小於0.2mm"; thisImages[0].sprite = thisSpriteRight[34]; thisImages[1].sprite = thisSpriteWrong[34]; } if (number == 2) { ContentText[1].text = "3.檢查轉接環外露灌漿面的密封可靠,並做防水處理"; thisImages[0].sprite = thisSpriteRight[35]; thisImages[1].sprite = thisSpriteWrong[35]; FinishPart2 = true; } if (number == 3) { ContentText[1].text = "4.檢查轉接環頂部、底部、內弧面是否存在裂縫,若存在,是否小於0.2mm"; thisImages[0].sprite = thisSpriteRight[36]; thisImages[1].sprite = thisSpriteWrong[36]; } } if (isNextModular[10]) { thisImages[0].gameObject.SetActive(true); thisImages[1].gameObject.SetActive(true); if (number == 0) { ContentText[1].text = "1.檢查鋼絞線束自由段,沒有和塔壁及其它物體意外接觸的跡象"; thisImages[0].sprite = thisSpriteRight[37]; thisImages[1].sprite = thisSpriteWrong[37]; } if (number == 1) { ContentText[1].text = "2.檢查所有金屬部件沒有生鏽"; thisImages[0].sprite = thisSpriteRight[38]; thisImages[1].sprite = thisSpriteWrong[38]; } if (number == 2) { ContentText[1].text = "3.檢查所有部件沒有機械或其它損傷"; thisImages[0].sprite = thisSpriteRight[39]; thisImages[1].sprite = thisSpriteWrong[39]; FinishPart3 = true; } if (number == 3) { ContentText[1].text = "4.使用手電筒檢測下面預埋管內部,不應有水分,鋼絞線束接觸管壁,未發生磨損,機械損傷,毛刺等現象"; thisImages[0].sprite = thisSpriteRight[40]; thisImages[1].sprite = thisSpriteWrong[40]; } } } //概括面板下確認按鈕 public void OK() { ContentStep(0);//顯示詳細巡檢內容第一條 OpenCharacterAction(); if(isNextModular[1]|| isNextModular[2]|| isNextModular[5]||isNextModular[6]||isNextModular[9]||isNextModular[10]) { Panel_Tips[2].SetActive(true); } if(isNextModular[3]|| isNextModular[4]||isNextModular[7]) { Panel_Tips[4].SetActive(true); } if (isNextModular[8]) { Panel_Tips[5].SetActive(true); } } /// <summary> /// 兩條檢測按鈕 /// </summary> public void YesButtonNum2() { if (isNextStep[0]) { ContentStep(1); isNextStep[1] = true; isNextStep[0] = false; } else if (isNextStep[1]) { ActiveGoButton(); Panel_Tips[5].SetActive(false); isNextStep[1] = false; isNextStep[0] = true; LastChoose(); thisImages[0].gameObject.SetActive(false); thisImages[1].gameObject.SetActive(false); } } /// <summary> /// 四條檢測按鈕 /// </summary> public void YesNutton() { if (isNextStep[0]) { ContentStep(1); isNextStep[1] = true; isNextStep[0] = false; } else if (isNextStep[1]) { ContentStep(2); isNextStep[1] = false; isNextStep[2] = true; } else if (isNextStep[2]) { ContentStep(3); isNextStep[2] = false; isNextStep[3] = true; } else if (isNextStep[3]) { Panel_Tips[2].SetActive(false);//詳細提示巡檢panel關閉 ActiveGoButton(); LastChoose(); isNextStep[3] = false; isNextStep[0] = true; thisImages[0].gameObject.SetActive(false); thisImages[1].gameObject.SetActive(false); } } /// <summary> /// 五條檢測按鈕 /// </summary> public void YesButtonNum5() { if (isNextStep[0]) { ContentStep(1); isNextStep[1] = true; isNextStep[0] = false; } else if (isNextStep[1]) { ContentStep(2); isNextStep[1] = false; isNextStep[2] = true; } else if (isNextStep[2]) { ContentStep(3); isNextStep[2] = false; isNextStep[3] = true; } else if (isNextStep[3]) { ContentStep(4); isNextStep[3] = false; isNextStep[4] = true; } else if (isNextStep[4]) { Panel_Tips[4].SetActive(false);//詳細提示巡檢panel關閉 ActiveGoButton(); isNextStep[0] = true; isNextStep[4] = false; LastChoose(); thisImages[0].gameObject.SetActive(false); thisImages[1].gameObject.SetActive(false); } } private bool IsR() { float number = Random.Range(0.0f, 1.0f); if (number <= 0.5f) { isRight = true; } else { isRight = false; } return isRight; } //是按鈕檢測完呼叫方法 public void LastChoose() { //if (FinishPart2) //{ // ContentText[3].text = "風機基礎及塔筒和塔筒內部檢查完畢"; // Panel_Tips[3].SetActive(true); // FinishPart2 = false; //} if (FinishPart3) { ContentText[3].text = "塔筒內部及塔底和基礎檢查完畢"; Panel_Tips[3].SetActive(true); FinishPart3= false; } if (isTrigger[2]) { Panel_Tips[0].SetActive(true); ContentText[2].text = "提示:風機基礎及塔筒和塔筒內部檢查"; thisHighLight.OnObject(1); IsStartTrigger = true; } if (isTrigger[3]) { Panel_Tips[0].SetActive(true); ContentText[2].text = "提示:風機基礎及塔筒和塔筒內部檢查" + "\n" + "請移動至塔內平臺0"; thisHighLight.OnObject(3); IsStartTrigger = true; } if (isTrigger[4]) { Panel_Tips[0].SetActive(true); ContentText[2].text = "提示:風機基礎及塔筒和塔筒內部檢查"+"\n" + "請移動至塔內平臺1"; thisHighLight.OnObject(4); IsStartTrigger = true; } if (isTrigger[5]) { Panel_Tips[0].SetActive(true); ContentText[2].text = "提示:風機基礎及塔筒和塔筒內部檢查" + "\n" + "請移動至塔內平臺2"; thisHighLight.OnObject(5); IsStartTrigger = true; } if (isTrigger[6]) { Panel_Tips[0].SetActive(true); ContentText[2].text = "提示:風機基礎及塔筒和塔筒內部檢查" + "\n" + "請移動至塔內平臺3"; thisHighLight.OnObject(6); IsStartTrigger = true; } if (isTrigger[7]) { Panel_Tips[0].SetActive(true); ContentText[2].text = "提示:風機基礎及塔筒和塔筒內部檢查" + "\n" + "請移動至塔內平臺4"; thisHighLight.OnObject(7); IsStartTrigger = true; } if (isTrigger[8]) { Panel_Tips[0].SetActive(true); ContentText[2].text = "提示:風機基礎及塔筒和塔筒內部檢查" + "\n" + "請移動至塔內平臺5"; thisHighLight.OnObject(8); IsStartTrigger = true; } if (isTrigger[9]) { Panel_Tips[0].SetActive(true); ContentText[2].text = "提示:風機基礎及塔筒和塔筒內部檢查" + "\n" + "請移動至塔內平臺6"; thisHighLight.OnObject(9); IsStartTrigger = true; } if (isTrigger[10]) { Panel_Tips[0].SetActive(true); ContentText[2].text = "提示:體外預應力束"; thisHighLight.OnObject(10); IsStartTrigger = true; } if (isTrigger[11]) { thisHighLight.OffObject(); } OpenCharacterAction(); } //開啟人物行動 public void OpenCharacterAction() { firstpersonController.enabled = true; firstpersonController.m_WalkSpeed = 1.0f; firstpersonController.m_RunSpeed = 3.0f; } //禁用人物移動 public void CloseCharacterAction() { firstpersonController.m_WalkSpeed = 0; firstpersonController.m_RunSpeed = 0; } //重新開始 public void AgainButton() { SceneManager.LoadScene(SceneManager.GetActiveScene().name); } //退出按鈕 public void ButtonExit() { Application.Quit(); } }
}