103 lines
4.1 KiB
C#
103 lines
4.1 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using XFrame.Core.UI;
|
|
public class GameMainFlowManagr : MonoBehaviour
|
|
{
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
XUIPanel.ShowPanel<MenuPanel>();
|
|
ToolData.AddToolData("梯子");
|
|
if (ScenesRecorder.OperationPhase.Equals(OperationPhase.On_SiteInspection))
|
|
{
|
|
if (ScenesRecorder.ExaminationLink.Equals("理论题答题"))
|
|
{
|
|
XUIPanel.ShowPanel<ExamDataPanel>("理论题答题");
|
|
XUIPanel.ShowPanel<TipPanel>("请开始答题");
|
|
}
|
|
else
|
|
{
|
|
XUIPanel.ShowPanel<ExamDataPanel>("低压线路巡视");
|
|
XUIPanel.ShowPanel<TipPanel>("请开始巡检工作,点击下方故障记录表记录故障");
|
|
}
|
|
GameManage.process = Process.第一次进入台区;
|
|
MenuPanel.instance.ChangeBtnInteractable(MenuPanel.instance.SDGzp, false);
|
|
}
|
|
else
|
|
{
|
|
if (ScenesRecorder.ExaminationLink.Equals("低压停电操作"))
|
|
{
|
|
XUIPanel.ShowPanel<ExamDataPanel>("低压停电操作");
|
|
XUIPanel.ShowPanel<OperationTicketPanel>();
|
|
MenuPanel.instance.ChangeBtnInteractable(MenuPanel.instance.FailureTicketBtn, false);
|
|
|
|
}
|
|
else if (ScenesRecorder.ExaminationLink.Equals("低压故障处理"))
|
|
{
|
|
XUIPanel.ShowPanel<ExamDataPanel>("低压故障处理");
|
|
XUIPanel.ShowPanel<TipPanel>("请点击故障记录表排故");
|
|
MenuPanel.instance.ChangeBtnInteractable(MenuPanel.instance.FailureTicketBtn, true);
|
|
if (ScenesRecorder.instance)
|
|
{
|
|
ScenesRecorder.OperationPhase = OperationPhase.Troubleshooting; //进入排故阶段
|
|
ExamDataPanel.instance.SetExamProcess("低压故障处理");
|
|
}
|
|
MenuPanel.instance.ChangeBtnInteractable(MenuPanel.instance.SDGzp, false);
|
|
MenuPanel.instance.ChangeBtnInteractable(MenuPanel.instance.FailureTicketBtn, true);
|
|
}
|
|
else if (ScenesRecorder.ExaminationLink.Equals("低压送电操作"))
|
|
{
|
|
XUIPanel.ShowPanel<ExamDataPanel>("低压送电操作");
|
|
XUIPanel.ShowPanel<OperationTicketPanel>();
|
|
MenuPanel.instance.ChangeBtnInteractable(MenuPanel.instance.FailureTicketBtn, false);
|
|
}
|
|
else
|
|
{
|
|
XUIPanel.ShowPanel<ExamDataPanel>("操作票填写");
|
|
|
|
MenuPanel.instance.ChangeBtnInteractable(MenuPanel.instance.SDGzp, true);
|
|
MenuPanel.instance.ChangeBtnInteractable(MenuPanel.instance.FailureTicketBtn, false);
|
|
XUIPanel.ShowPanel<TipPanel>("工作票已开好,现在请填写操作票");
|
|
}
|
|
}
|
|
XUIPanel.ShowPanel<SelectScenePanel>();
|
|
// 开始录屏
|
|
if (ScenesRecorder.instance.openVideoBack)
|
|
{
|
|
string path = VidepPlayBackPath.GetPath();
|
|
string videoName = VidepPlayBackPath.GetNextFolder();
|
|
ScreenCaptureManager.instance.StartCapture(path, videoName);
|
|
}
|
|
}
|
|
public void ShowOperationTicket()
|
|
{
|
|
XUIPanel.ShowPanel<OperationTicketPanel>();
|
|
}
|
|
private void Update()
|
|
{
|
|
if (Input.GetMouseButtonDown(1))
|
|
{
|
|
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
|
|
RaycastHit raycast;
|
|
if (Physics.Raycast(ray, out raycast, 20))
|
|
{
|
|
if (raycast.transform.gameObject.tag == "enclosure")
|
|
{
|
|
Enclosure esure = raycast.transform.GetComponentInParent<Enclosure>();
|
|
if (esure)
|
|
{
|
|
XFrame.Core.UI.XUIPanel.ShowPanel<TipsCheckPanel>((a) =>
|
|
{
|
|
if ((bool)a)
|
|
{
|
|
esure.gameObject.SetActive(false);
|
|
}
|
|
}, "确认撤收<Color=red>“围栏”</Color>?", false);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|