Tz2/Assets/Zion/Scripts/配送/ELP/ELP_TerminalMonitorsArrival...

110 lines
2.9 KiB
C#

using DefaultNamespace.ProcessMode;
using System.Collections;
using System.Collections.Generic;
using System.Threading;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
/// <summary>
/// 绑定终端、启动监控、到货验收
/// </summary>
public class ELP_TerminalMonitorsArrivalHandover : MonoBehaviour
{
public TMP_InputField Select;
/// <summary>
/// 终端号选择面板
/// </summary>
public GameObject TerminalNumPanel;
/// <summary>
/// 车牌号输入框
/// </summary>
public TMP_InputField CarNum;
/// <summary>
/// 车牌号查询按钮
/// </summary>
public Button CarNumSelect;
/// <summary>
/// 车牌号校验结果
/// </summary>
public GameObject CarNumoutcome;
/// <summary>
/// 终端号右移按钮
/// </summary>
public Button AddRightBt;
/// <summary>
/// 右侧终端号显示面板
/// </summary>
public GameObject RightPanel;
/// <summary>
/// 监控按钮
/// </summary>
public Button monitorbt;
/// <summary>
/// 预警按钮
/// </summary>
public Button Earlywarning;
/// <summary>
/// 到货交接按钮
/// </summary>
public Button connectbt;
bool isclickright = false;
void Start()
{
Earlywarning.onClick.AddListener(() =>
{
MotionFramework.MotionEngine.GetModule<ProcessManager>().HandleClick(new List<string>()
{
"true"
});
});
monitorbt.onClick.AddListener(() =>
{
MotionFramework.MotionEngine.GetModule<ProcessManager>().HandleClick(new List<string>()
{
"true"
});
});
connectbt.onClick.AddListener(() =>
{
MotionFramework.MotionEngine.GetModule<ProcessManager>().HandleClick(new List<string>()
{
"true"
});
});
CarNumSelect.onClick.AddListener(() =>
{
if (CarNum.text.Contains("苏F88428"))
{
MotionFramework.MotionEngine.GetModule<ProcessManager>().HandleClick(new List<string>()
{
RightPanel.activeInHierarchy.ToString().ToLower(),"true"
});
CarNumoutcome.SetActive(true);
}
});
AddRightBt.onClick.AddListener(() =>
{
isclickright = true;
RightPanel.SetActive(true);
TerminalNumPanel.SetActive(false);
});
}
void Update()
{
if (Select.text != "" && !isclickright)
{
TerminalNumPanel.SetActive(true);
AddRightBt.gameObject.SetActive(true);
}
else
{
TerminalNumPanel.SetActive(false);
AddRightBt.gameObject.SetActive(false);
}
}
}