54 lines
1.4 KiB
C#
54 lines
1.4 KiB
C#
using DG.Tweening;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
/// <summary>
|
|
/// 导电片
|
|
/// </summary>
|
|
public class Device_ConductiveSheet : Device_Base
|
|
{
|
|
public bool isInstall;
|
|
/// <summary>
|
|
/// 铁片固定扳手螺丝
|
|
/// </summary>
|
|
public Tool_SpannerScrew screw;
|
|
/// <summary>
|
|
///低压电流互感器安装触发区
|
|
/// </summary>
|
|
public DeviceTrigger LowVoltageCurrentTransformer_Trigger;
|
|
/// <summary>
|
|
/// 低压电流互感器
|
|
/// </summary>
|
|
public Device_LowVoltageCurrentTransformer transformer;
|
|
protected override void OnMDown()
|
|
{
|
|
base.OnMDown();
|
|
|
|
if (!screw.isInstall)
|
|
{
|
|
if (triggerAction?.Invoke(triggerName, false) == 0)
|
|
{
|
|
if (isInstall)
|
|
{
|
|
//合上
|
|
transform.DOLocalRotate(new Vector3(0, 0, 25), 0.5f).OnComplete(() =>
|
|
{
|
|
isInstall = true;
|
|
base.CallScoreAction(true);
|
|
});
|
|
}
|
|
else
|
|
{
|
|
//打开
|
|
transform.DOLocalRotate(new Vector3(0, 0, 0), 0.5f).OnComplete(() =>
|
|
{
|
|
isInstall = false;
|
|
base.CallScoreAction(false);
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|