58 lines
1.8 KiB
C#
58 lines
1.8 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
/// <summary>
|
|
/// 直接接入式电能计量装置_铭牌
|
|
/// </summary>
|
|
public class Device_NamePlate : Device_Base
|
|
{
|
|
/// <summary>
|
|
/// 是否检查
|
|
/// </summary>
|
|
public bool isChecked;
|
|
|
|
/// <summary>
|
|
/// 核对和抄录UI
|
|
/// </summary>
|
|
private GameObject checkUiPrefb;
|
|
|
|
protected override void OnMDown()
|
|
{
|
|
if ((triggerAction == null ? 0 : triggerAction.Invoke(triggerName, false)) == 0)
|
|
{
|
|
base.OnMDown();
|
|
if (!isChecked)
|
|
{
|
|
//核对和记录
|
|
if (checkUiPrefb == null)
|
|
{
|
|
checkUiPrefb = Resources.Load<GameObject>("UI/UI_Tip/ProcessTipPanel");
|
|
}
|
|
|
|
//生成进度条
|
|
GameObject tip = Instantiate<GameObject>(checkUiPrefb, GameManager.UIMgr.canvas.transform);
|
|
ProcessTipPanel processTipPanel = tip.GetComponent<ProcessTipPanel>();
|
|
|
|
//开始走进度
|
|
processTipPanel.StartProcess(result =>
|
|
{
|
|
if (result)
|
|
{
|
|
Debug.Log("核查完成");
|
|
isChecked = true;
|
|
TipPanel tTemp = Resources.Load<TipPanel>("UI/UI_Tip/TipPanel");
|
|
if (GameManager.UIMgr != null)
|
|
{
|
|
TipPanel tip2 = Instantiate(tTemp, GameManager.UIMgr.canvas.transform);
|
|
tip2.Init("核对和抄录完成!");
|
|
}
|
|
int state = (triggerAction == null ? 0 : triggerAction.Invoke(triggerName, true));
|
|
CallScoreAction();
|
|
}
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|