using HighlightPlus; //using Microsoft.SqlServer.Server; using System; using System.Collections; using System.Collections.Generic; using Unity.VisualScripting; using UnityEngine; using UnityEngine.EventSystems; /// /// 绝缘导线ui /// public class InsulatedConductorPanel : MonoBehaviour { public GameObject 黄; public GameObject 绿; public GameObject 红; public GameObject 黑; private Tool_InsulatedConductor insulatedConductor; public void Init(Tool_InsulatedConductor insulatedConductor) { this.insulatedConductor= insulatedConductor; if (GameManager.RunModelMgr?.ModeType == E_ModeType.Study) GameManager.EventMgr.AddEventListener(Enum_EventType.SwitchSubProcessStepTriggerID, SwitchSubProcessStepTriggerID); } /// /// 选择线(变大) /// /// public void Chose(BaseEventData baseEventData) { PointerEventData pd =(PointerEventData)baseEventData; if (GameManager.ProcessMgr.IsRightSubProcessStepsTriggerID("选择" + pd.pointerClick.gameObject.name + "线", true) == 0) { 黄.transform.localScale = new Vector3(1, 1, 1) * (pd.pointerClick.gameObject == 黄 ? 1.5f : 1); 绿.transform.localScale = new Vector3(1, 1, 1) * (pd.pointerClick.gameObject == 绿 ? 1.5f : 1); 红.transform.localScale = new Vector3(1, 1, 1) * (pd.pointerClick.gameObject == 红 ? 1.5f : 1); 黑.transform.localScale = new Vector3(1, 1, 1) * (pd.pointerClick.gameObject == 黑 ? 1.5f : 1); insulatedConductor.currentChoseLine = pd.pointerClick.gameObject; } } private void OnDestroy() { if (GameManager.RunModelMgr?.ModeType == E_ModeType.Study) GameManager.EventMgr.RemoveEventListener(Enum_EventType.SwitchSubProcessStepTriggerID, SwitchSubProcessStepTriggerID); } /// /// 提示是高亮 /// /// public void SwitchSubProcessStepTriggerID(string arg0) { try { if (arg0 == "选择红线" || arg0 == "选择绿线" || arg0 == "选择黄线" || arg0 == "选择黑线") { 红.GetComponentInChildren(true).gameObject.SetActive(arg0 == "选择红线"); 绿.GetComponentInChildren(true).gameObject.SetActive(arg0 == "选择绿线"); 黄.GetComponentInChildren(true).gameObject.SetActive(arg0 == "选择黄线"); 黑.GetComponentInChildren(true).gameObject.SetActive(arg0 == "选择黑线"); } else { 红.GetComponentInChildren(true).gameObject.SetActive(false); 绿.GetComponentInChildren(true).gameObject.SetActive(false); 黄.GetComponentInChildren(true).gameObject.SetActive(false); 黑.GetComponentInChildren(true).gameObject.SetActive(false); } } catch (Exception e) { Debug.LogError(e.Message + " " + arg0); } } }