80 lines
2.5 KiB
C#
80 lines
2.5 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class UI_ComputerSystemJLZXJCPanel : UI_ComputerSystemBasePanel
|
|
{
|
|
public string triggerName = "";
|
|
|
|
public GameObject TransResultPanel;//结果面板
|
|
public GameObject InterrogationPanel;//召测面板
|
|
|
|
bool IsTranscribed = false;//已经透抄
|
|
bool IsInterrogation = false;//已经召测
|
|
public override void ShowMe()
|
|
{
|
|
base.ShowMe();
|
|
TransResultPanel.SetActive(false);//透抄结果面板关闭
|
|
InterrogationPanel.SetActive(false);//召测面板关闭
|
|
IsTranscribed = false;//透抄结果为false
|
|
IsInterrogation = false;//召测结果为false
|
|
GetControl<Button>("closeBtn").gameObject.SetActive(true);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 按钮点击
|
|
/// </summary>
|
|
/// <param name="btnName"></param>
|
|
protected override void OnClick(string btnName)
|
|
{
|
|
switch (btnName)
|
|
{
|
|
case "backBtn":
|
|
GameManager.UIMgr.HidePanel<UI_ComputerSystemJLZXJCPanel>();
|
|
GameManager.UIMgr.ShowPanel<UI_ComputerSystemHomePagePanel>();
|
|
break;
|
|
case "transcribeBtn":
|
|
if (!IsTranscribed)
|
|
{
|
|
StartCoroutine(Transcribe());
|
|
}
|
|
break;
|
|
case "interrogationBtn":
|
|
if (!IsInterrogation)
|
|
{
|
|
StartCoroutine(Interrogation());
|
|
}
|
|
break;
|
|
case "closeBtn":
|
|
GameManager.UIMgr.HidePanel<UI_ComputerSystemJLZXJCPanel>();
|
|
if (IsTranscribed && IsInterrogation)
|
|
{
|
|
GameManager.ProcessMgr.IsRightSubProcessStepsTriggerID(triggerName, true);
|
|
ScoreManager.instance.Check(triggerName, "透抄检查完成");
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 透抄
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
protected IEnumerator Transcribe()
|
|
{
|
|
TransResultPanel.SetActive(true);//显示透抄结果面板
|
|
yield return new WaitForSeconds(3);
|
|
TransResultPanel.SetActive(false);//隐藏透抄结果面板
|
|
IsTranscribed = true;//透抄结果为true
|
|
}
|
|
|
|
protected IEnumerator Interrogation()
|
|
{
|
|
InterrogationPanel.SetActive(true);//显示召测面板
|
|
yield return new WaitForSeconds(3);
|
|
InterrogationPanel.SetActive(false);//隐藏召测面板
|
|
IsInterrogation = true;//召测结果为true
|
|
}
|
|
}
|