using DefaultNamespace.ProcessMode; using Framework.Manager; using HighlightPlus; using System.Collections; using System.Collections.Generic; using DefaultNamespace; using MotionFramework; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; using static InterfaceManager; public class CheckGoods : MonoBehaviour { [Header("物资_品类一致")] public GameObject objPLGood; [Header("物资_品类不一致")] public GameObject objPLBad; [Header("物资_厂家一致")] public GameObject objCJGood; [Header("物资_厂家不一致")] public GameObject objCJBad; [Header("物资_好")] public GameObject objGood; [Header("物资_坏")] public GameObject objBad; [Header("坏物资组")] public List objBadlist; //指向箭头 [Header("UI_指向箭头")] public GameObject arrowObj; //指向箭头 [Header("UI_指向箭头")] public GameObject arrowObj2; //界面 public GameObject UI; /// /// 标牌 /// [Header("UI_标牌")] public Transform scutcheon; /// /// 标牌2 /// [Header("UI_标牌")] public Transform scutcheon2; /// /// 一致品类UI高度 /// public float PosYGood; /// /// 不一致品类UI高度 /// public float PosYBad; /// /// 物资_品类一致 /// public Toggle TogPLGood, TogPLBad; /// /// 物资_品类一致 /// public Transform HighlightObjTogPLGood, HighlightObjTogPLBad; /// /// 物资_厂家一致 /// public Toggle TogCJGood, TogCJBad; /// /// 物资_厂家一致 /// public Transform HighlightObjTogCJGood, HighlightObjTogCJBad; /// /// 物资_好 /// public Toggle TogGood, TogBad; /// /// 物资_好 /// public Transform HighlightObjTogGood, HighlightObjTogBad; /// /// 关闭按钮 /// public Button btnClose; public Button btnClose1; /// /// /// public Button btnOpen; /// /// 是否完成检查 /// public bool isCheckCompleted; /// /// 物品的BoxCollider /// private BoxCollider boxCollider; /// /// 是否码放完毕 /// public bool IsTask; /// /// 厂家 /// public Text Manufacturer; /// /// 高亮插件 /// public HighlightEffect highlightEffect; public GameObject plane1; public GameObject plane2; public Toggle tog1; public Toggle tog2; // Start is called before the first frame update // void Start() // { // Init(); // } public void Init() { // //物资品类是否一致 // objPLGood.SetActive(true); //一致 // objPLBad.SetActive(false); //不一致 // //物资厂家是否一致 // objCJGood.SetActive(true); //一致 // objCJBad.SetActive(false); //不一致 // //物资是否好 // objGood.SetActive(true); //好 // objBad.SetActive(false); //坏 boxCollider = GetComponent(); highlightEffect = GetComponent(); if (boxCollider != null) boxCollider.enabled = false; //检查外观 //标牌高度调节 if (MotionEngine.GetModule().ExamName == "领用出库") { UI = plane2; } //scutcheon.transform.localPosition = new Vector3(0, PosYGood, 0); // if (objPLGood.activeSelf) // scutcheon.transform.localPosition = new Vector3(0, PosYGood, 0); // else if (objPLBad.activeSelf) // scutcheon.transform.localPosition = new Vector3(0, PosYBad, 0); LookTrans.Instance.TransAddTransform(UI.transform.parent); if (scutcheon2 != null) { LookTrans.Instance.TransAddTransform(scutcheon2); } btnOpen.onClick.AddListener(() => { UI.SetActive(true); arrowObj.SetActive(false); }); btnClose.onClick.AddListener(() => { List list = new List(); //list.Add(TogPLGood.isOn.ToString()); //list.Add(TogPLBad.isOn.ToString()); //MotionEngine.GetModule().HandleClick(list); UI.SetActive(false); isCheckCompleted = true; ModerController.Instance.CheckGoodsCheckCompleted(); HighlightObjTogPLGood.gameObject.SetActive(false); HighlightObjTogPLBad.gameObject.SetActive(false); HighlightObjTogCJGood.gameObject.SetActive(false); HighlightObjTogCJBad.gameObject.SetActive(false); HighlightObjTogGood.gameObject.SetActive(false); HighlightObjTogBad.gameObject.SetActive(false); }); if (btnClose1 != null) { btnClose1.onClick.AddListener(() => { List list = new List(); list.Add(tog1.isOn.ToString()); list.Add(tog2.isOn.ToString()); if (MotionEngine.GetModule().HandleClick(list)) { UI.SetActive(false); isCheckCompleted = true; TutorialGuideManager.Instance.NextGuideIn(); } }); } } /// /// 完成上架 /// public void OnShelve() { scutcheon.gameObject.SetActive(false); if (boxCollider != null) boxCollider.enabled = true; gameObject.SetActive(false); } /// /// 外部调用,电力电缆使用 /// public void CheckOut() { ModerController.Instance.CheckGoodsCheckCompleted(); } private void OnMouseDown() { //鼠标在UI上return if (EventSystem.current.IsPointerOverGameObject()) return; transform.localEulerAngles = transform.localEulerAngles + new Vector3(0, 90, 0); IsTask = !IsTask; highlightEffect.SetHighlighted(!IsTask); } //物资码放完毕 public void OnGoodsCode() { if (boxCollider != null) boxCollider.enabled = false; } /// /// 品类一致 /// /// public void PLCJ(string pl, string cj, string obj) { if (pl == "一致") { objPLGood.SetActive(true); objPLBad.SetActive(false); if (MotionFramework.MotionEngine.GetModule()._currentMode == ProcessMode.教学模式 && TutorialGuideManager.Instance) { HighlightObjTogPLGood.gameObject.SetActive(true); } } else { objPLGood.SetActive(false); objPLBad.SetActive(true); if (MotionFramework.MotionEngine.GetModule()._currentMode == ProcessMode.教学模式 && TutorialGuideManager.Instance) { HighlightObjTogPLBad.gameObject.SetActive(true); } } if (cj == "一致") { objCJGood.SetActive(true); objCJBad.SetActive(false); if (MotionFramework.MotionEngine.GetModule()._currentMode == ProcessMode.教学模式 && TutorialGuideManager.Instance) { HighlightObjTogCJGood.gameObject.SetActive(true); } } else { objCJGood.SetActive(false); objCJBad.SetActive(true); if (MotionFramework.MotionEngine.GetModule()._currentMode == ProcessMode.教学模式 && TutorialGuideManager.Instance) { HighlightObjTogCJBad.gameObject.SetActive(true); } } if (obj == "完好") { objGood.SetActive(true); objBad.SetActive(false); if (MotionFramework.MotionEngine.GetModule()._currentMode == ProcessMode.教学模式 && TutorialGuideManager.Instance) { HighlightObjTogGood.gameObject.SetActive(true); } } else { // objGood.SetActive(false); // objBad.SetActive(true); if (MotionFramework.MotionEngine.GetModule()._currentMode == ProcessMode.教学模式 && TutorialGuideManager.Instance) { HighlightObjTogBad.gameObject.SetActive(true); } } } }