62 lines
1.9 KiB
C#
62 lines
1.9 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using DG.Tweening;
|
|
|
|
/// <summary>
|
|
/// 直接接入式电能计量装置_铭牌
|
|
/// </summary>
|
|
public class Device_NamePlate : Device_Base
|
|
{
|
|
/// <summary>
|
|
/// 是否检查
|
|
/// </summary>
|
|
[ReconnetAtrribute]
|
|
public bool isChecked;
|
|
|
|
///// <summary>
|
|
///// 核对和抄录UI
|
|
///// </summary>
|
|
//private GameObject checkUiPrefb;
|
|
|
|
protected override void OnMDown()
|
|
{
|
|
if (!base.isMoving)
|
|
{
|
|
if ((triggerAction == null ? 0 : triggerAction.Invoke(triggerName, false)) == 0)
|
|
{
|
|
base.OnMDown();
|
|
{
|
|
//核对和记录
|
|
//if (checkUiPrefb == null)
|
|
//{
|
|
// checkUiPrefb = Resources.Load<GameObject>("UI/UI_Tip/ProcessTipPanel");
|
|
//}
|
|
|
|
isMoving = true;
|
|
float y = transform.localPosition.y;
|
|
transform.DOLocalMoveY(y + 0.05f, 1).OnUpdate(() =>
|
|
{
|
|
transform.localScale += Vector3.one * Time.deltaTime * 2;
|
|
}).OnComplete(() =>
|
|
{
|
|
transform.DOLocalMoveY(y, 1).SetDelay(1).OnUpdate(() =>
|
|
{
|
|
transform.localScale -= Vector3.one * Time.deltaTime * 2;
|
|
}).OnComplete(() =>
|
|
{
|
|
isMoving = false;
|
|
transform.localScale = Vector3.one;
|
|
Debug.Log("核查完成");
|
|
isChecked = true;
|
|
TipPanel.ShowTip("核对和抄录完成!");
|
|
triggerAction?.Invoke(triggerName, true);
|
|
CallScoreAction();
|
|
});
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|