ShanxiKnowledgeBase/SXElectricalInspection/Assets/Adam/Scripts/ExitCheckController.cs

76 lines
2.0 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class ExitCheckController : MonoBehaviour
{
public GameObject ExitCheckPanel;
public GameObject End;
public Button QDButton;
public Button QXButton;
public Text text_sub;
public int num_click;
// Start is called before the first frame update
void Start()
{
num_click = 0;
QDButton.onClick.AddListener(() =>
{
num_click++;
ResetPlane();
});
QXButton.onClick.AddListener(() =>
{
num_click = 0;
ExitCheckPanel.SetActive(false);
});
UIManager.Instance.time.timeOver.AddListener(() =>
{
num_click = 2;
ResetPlane();
});
}
public void ResetPlane()
{
switch (num_click)
{
case 0:
text_sub.text = "是否确认退出检查!!!";
break;
case 1:
text_sub.text = "结束检查后无法重回现场检查,请填写纸质材料。";
break;
case 2:
foreach (Toggle item in UIManager.Instance.bottomCotroller.toggles)
{
item.isOn = false;
item.gameObject.SetActive(false);
if (item.name == "异常记录")
{
item.gameObject.SetActive(true);
item.isOn = true;
}
}
WaitUpScore();
UIManager.Instance.bottomCotroller.BirdEyeView.gameObject.SetActive(false);
End.SetActive(true);
ExitCheckPanel.SetActive(false);
break;
}
}
private async void WaitUpScore()
{
int jobCardScore = UIManager.Instance.jobCardController.AddScore();
await FractionManager.Instance.overAsync(1, jobCardScore, "工作卡");
}
}