42 lines
1.2 KiB
C#
42 lines
1.2 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
/// <summary>
|
|
/// 检查接线完好
|
|
/// </summary>
|
|
public class Check_JieXian : PermanentTriggerBase
|
|
{
|
|
/// <summary>
|
|
/// 是否已检查接线完好
|
|
/// </summary>
|
|
public bool isChecked;
|
|
private void OnMouseDown()
|
|
{
|
|
if (SiteManager.instance.measuringCabinet.jieXian_lines.TrueForAll(a=>a.isConnected) && SiteManager.instance.measuringCabinet.meteringDevice.jieXian_screws.TrueForAll(a=>a.isInstall))
|
|
{
|
|
Invoke("Check", 1);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 检查成功
|
|
/// </summary>
|
|
public void Check()
|
|
{
|
|
Debug.Log("接线完好");
|
|
isChecked = true;
|
|
GetComponent<BoxCollider>().enabled = false;
|
|
|
|
if (GameManager.UIMgr != null)
|
|
{
|
|
GameObject tip2 = Instantiate<GameObject>(Resources.Load<GameObject>("UI/UI_Tip/TipPanel"), UIManager.Instance.canvas.transform);
|
|
TipPanel tipPanel = tip2.GetComponent<TipPanel>();
|
|
tipPanel.Init("接线完好!");
|
|
}
|
|
|
|
if (GameManager.ProcessMgr != null)
|
|
GameManager.ProcessMgr.IsRightSubProcessStepsTriggerID(triggerName, true);
|
|
}
|
|
}
|