CultivationOfBrewing-2/Assets/Scripts/CXX/Devices/专变采集终端/Device_SpecializedVariableA...

51 lines
1.4 KiB
C#

using DG.Tweening;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Device_SpecializedVariableAcquisitionTerminal_NatePlane : Device_Base
{
/// <summary>
/// 是否查看
/// </summary>
public bool isLook;
public Vector3 init;
public Vector3 to;
protected override void OnMDown()
{
base.OnMDown();
if (!isMoving)
{
if (triggerAction == null || triggerAction.Invoke(triggerName, false) == 0)
{
Watch();
}
}
}
public void Watch()
{
isMoving = true;
//放大
var tween= transform.DOLocalMove(to, 1);
tween.OnUpdate(() =>
{
transform.localScale = Vector3.one +Vector3.one * tween.ElapsedPercentage()*9;
}).OnComplete(() =>
{
TipPanel.ShowTip("终端的编号、型号、安装地址等信息与工作单一致");
//还原
var tween2=transform.DOLocalMove(init, 1);
tween2.OnUpdate(() =>
{
transform.localScale = Vector3.one + Vector3.one * (1- tween2.ElapsedPercentage()) * 9;
}).OnComplete(() =>
{
isMoving = false;
isLook = true;
triggerAction?.Invoke(triggerName, true);
CallScoreAction();
}).SetDelay(3);
});
}
}