Merge branch 'main' of http://5a4e4c01.r5.cpolar.top/WangWeiZhi/YanCheng_Metrology
This commit is contained in:
commit
980e89a2b0
|
@ -14,6 +14,10 @@ public class Tool_TestPen : Tool_Base
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private bool isFlicker;
|
private bool isFlicker;
|
||||||
private float time;
|
private float time;
|
||||||
|
/// <summary>
|
||||||
|
/// ÊÇ·ñ»Øµ½ÊÖÀï
|
||||||
|
/// </summary>
|
||||||
|
private float backToHandTime;
|
||||||
|
|
||||||
private void Update()
|
private void Update()
|
||||||
{
|
{
|
||||||
|
@ -21,7 +25,7 @@ public class Tool_TestPen : Tool_Base
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
||||||
if (Input.GetMouseButtonDown(0))
|
if (Input.GetMouseButtonDown(0) && !isMoving)
|
||||||
{
|
{
|
||||||
//点击螺丝验电
|
//点击螺丝验电
|
||||||
Ray tmpray = Camera.main.ScreenPointToRay(Input.mousePosition);
|
Ray tmpray = Camera.main.ScreenPointToRay(Input.mousePosition);
|
||||||
|
@ -62,6 +66,19 @@ public class Tool_TestPen : Tool_Base
|
||||||
time = 0;
|
time = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//ÊÕ»ØÊÖÖÐ
|
||||||
|
if(backToHandTime>0)
|
||||||
|
{
|
||||||
|
backToHandTime -= Time.deltaTime;
|
||||||
|
if (backToHandTime <= 0)
|
||||||
|
{
|
||||||
|
if (!isMoving)
|
||||||
|
{
|
||||||
|
base.ReBackHead();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 执行验电操作
|
/// 执行验电操作
|
||||||
|
@ -73,6 +90,8 @@ public class Tool_TestPen : Tool_Base
|
||||||
{
|
{
|
||||||
if (device_base.deviceType == DeviceType.计量柜_插座)
|
if (device_base.deviceType == DeviceType.计量柜_插座)
|
||||||
{
|
{
|
||||||
|
isMoving = true;
|
||||||
|
backToHandTime = 3f;
|
||||||
var tmp = ((Device_Socket)device_base);
|
var tmp = ((Device_Socket)device_base);
|
||||||
//位置移动
|
//位置移动
|
||||||
base.hand_out_action?.Invoke();
|
base.hand_out_action?.Invoke();
|
||||||
|
@ -84,14 +103,15 @@ public class Tool_TestPen : Tool_Base
|
||||||
isFlicker = tmp.hasElectricity;
|
isFlicker = tmp.hasElectricity;
|
||||||
screem.materials[0].color = isFlicker ? Color.red : Color.white;
|
screem.materials[0].color = isFlicker ? Color.red : Color.white;
|
||||||
int index = (triggerAction == null ? 0 : triggerAction.Invoke($"{triggerName}+{device_base.triggerName}", true));
|
int index = (triggerAction == null ? 0 : triggerAction.Invoke($"{triggerName}+{device_base.triggerName}", true));
|
||||||
base.hand_back_action?.Invoke();
|
isMoving = false;
|
||||||
|
backToHandTime = 3f;
|
||||||
base.CallScoreAction(null, $"{triggerName}+{device_base.triggerName}");
|
base.CallScoreAction(null, $"{triggerName}+{device_base.triggerName}");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else if (device_base.deviceType == DeviceType.计量柜_柜门)
|
else if (device_base.deviceType == DeviceType.计量柜_柜门)
|
||||||
{
|
{
|
||||||
var tmp = ((Device_CabinetDoor)device_base);
|
var tmp = ((Device_CabinetDoor)device_base);
|
||||||
|
backToHandTime = 3f;
|
||||||
//位置移动
|
//位置移动
|
||||||
base.hand_out_action?.Invoke();
|
base.hand_out_action?.Invoke();
|
||||||
transform.parent = null;
|
transform.parent = null;
|
||||||
|
@ -102,7 +122,8 @@ public class Tool_TestPen : Tool_Base
|
||||||
isFlicker = tmp.hasElectricity;
|
isFlicker = tmp.hasElectricity;
|
||||||
screem.materials[0].color = isFlicker ? Color.red : Color.white;
|
screem.materials[0].color = isFlicker ? Color.red : Color.white;
|
||||||
int index = (triggerAction == null ? 0 : triggerAction.Invoke($"{triggerName}+{device_base.triggerName}", true));
|
int index = (triggerAction == null ? 0 : triggerAction.Invoke($"{triggerName}+{device_base.triggerName}", true));
|
||||||
base.hand_back_action?.Invoke();
|
isMoving = false;
|
||||||
|
backToHandTime = 3f;
|
||||||
base.CallScoreAction(null, $"{triggerName}+{device_base.triggerName}");
|
base.CallScoreAction(null, $"{triggerName}+{device_base.triggerName}");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -119,6 +140,8 @@ public class Tool_TestPen : Tool_Base
|
||||||
{
|
{
|
||||||
if (tool_base.toolType == ToolType.螺丝)
|
if (tool_base.toolType == ToolType.螺丝)
|
||||||
{
|
{
|
||||||
|
isMoving = true;
|
||||||
|
backToHandTime = 3f;
|
||||||
var tmp = ((Tool_Screw)tool_base);
|
var tmp = ((Tool_Screw)tool_base);
|
||||||
base.hand_out_action?.Invoke();
|
base.hand_out_action?.Invoke();
|
||||||
//位置移动
|
//位置移动
|
||||||
|
@ -129,12 +152,11 @@ public class Tool_TestPen : Tool_Base
|
||||||
Debug.Log("螺丝 已验电");
|
Debug.Log("螺丝 已验电");
|
||||||
isFlicker = tmp.hasElectricity;
|
isFlicker = tmp.hasElectricity;
|
||||||
screem.materials[0].color = isFlicker ? Color.red : Color.white;
|
screem.materials[0].color = isFlicker ? Color.red : Color.white;
|
||||||
base.hand_back_action?.Invoke();
|
isMoving = false;
|
||||||
|
backToHandTime = 3f;
|
||||||
base.CallScoreAction(null, $"{triggerName}+{tool_base.triggerName}");
|
base.CallScoreAction(null, $"{triggerName}+{tool_base.triggerName}");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue