using DG.Tweening; using Newtonsoft.Json; using System; using System.Collections; using System.Collections.Generic; using System.IO; using System.Linq; using System.Reflection; using Unity.Burst.CompilerServices; using UnityEngine; using UnityEngine.Networking; using UnityEngine.UI; using static DeviceQuery; using static ENVQuery; using static PortQuery; using static TmsAlarmQuery; public class GameManager : MonoBehaviour { public static GameManager Inst; /// /// 接口地址 /// public webURL Jk_URL; /// /// 全局变量 /// public GlobalParameter arguments = new GlobalParameter(); /// /// 是否加载完成 /// public bool isLoading = false; string ct = null; //[Header("机柜点位集合")] //public List Cabinets_POS; [Header("机柜区域集合")] public List Cabinet_quYu; [Header("当前设备ID")] public string nowDeviceID = null; [Header("当前点击设备")] public GameObject nowDevice = null; [Header("上一个设备ID")] public string lastDeviceID = null; [Header("上一个点击设备")] public GameObject lastDevice = null; /// /// 当前聚焦机柜 /// [Header("当前聚焦机柜")] public GameObject nowCabine; /// /// 当前查看的设备 /// [Header("当前查看的设备")] public GameObject now_CK_Device = null; [Header("设备------------------------查询接口")] public DeviceQuery.Root root_AllDevice; ///// ///// 场景所有机柜 ///// // public List Cabinets_go; /// /// 场景所有机柜 /// [Header("场景所有机柜")] public List Cabinets_go; /// /// 场景所有机柜信息 /// public List Cabinets; /// /// 场景所有机框 /// [Header("场景所有机框信息")] public List Racks_go = new List(); /// /// 场景所有机框信息 /// public List Racks; /// /// 场景所有机槽 /// [Header("场景所有机槽信息")] public List MachineSlots_go = new List(); /// /// 场景所有机槽信息 /// public List MachineSlots; /// /// 场景所有板卡 /// [Header("场景所有板卡信息")] public List TmsCards_go = new List(); /// /// 场景所有板卡信息 /// public List TmsCards; [Header("端口------------------------查询接口")] public PortQuery.Root root_AllPort; /// /// 场景所有端口 /// [Header("场景所有端口信息")] public List TmsPorts_go = new List(); /// /// 场景所有端口信息 /// public List TmsPorts; [HideInInspector] public int nowLayerMask = 6; [Header("环境------------------------查询接口")] public ENVQuery.Root root_AllENV = new ENVQuery.Root(); public List ENVs; [Header("告警------------------------查询接口")] public TmsAlarmQuery.Root root_AllAlarm = new TmsAlarmQuery.Root(); public List tmsAlarms; ///// ///// 搜索框 ///// //[Header("--------------------------------")] //public GameObject search_box; [Header("----------弹窗--------------")] public List pop_ups; /// /// 场景方大状态 /// [Header("----------场景放大状态--------------")] public bool magnifyState = false; [Header("----------是否在循环读取信息--------------")] public bool isgonging = false; public EditorMenu editorMenu; [Header("---------- 暂存箱子 --------------")] public GameObject stagingPanel; public Button stagingPanelClose_bt; [Header("-------------- 搜索框------------------")] //public GameObject objectToShow; public GameObject search_box; public GameObject objectToShow_add; [Header("-------------- 所有机柜门------------------")] public List roomDoors; private void Awake() { if (Inst != this && Inst != null) { Destroy(this.gameObject); } else { Inst = this; DontDestroyOnLoad(this.gameObject); } //StartCoroutine(LoadAddress()); } private void Start() { Debug.Log("版本号 11.0.3"); roomDoors = CabinetUIManager.Instance.transform.GetChild(0).GetComponentsInChildren(true).ToList(); editorMenu.editorBtn.onClick.AddListener(() => { if (Menu.M_数字机房_场景管理 == CabinetUIManager.Instance.current_menu && nowDevice != null) { if (nowDevice.GetComponent() == null) return; //if (nowDevice.GetComponent().deviceList.deviceType == "3") // return; if (string.IsNullOrEmpty(nowDeviceID)) { PatternChoose.Inst.sb_xz_page.SetActive(true);//√ //objectToShow_add.gameObject.SetActive(false); var SN1 = objectToShow_add.GetComponent(); SN1.hide_menu(); objectToShow_add.SetActive(false); } else { PatternChoose.Inst.sb_bj_page.SetActive(true);//√ //objectToShow_add.gameObject.SetActive(false); var SN1 = objectToShow_add.GetComponent(); SN1.hide_menu(); objectToShow_add.SetActive(false); } } editorMenu.gameObject.SetActive(false); search_box.SetActive(false); }); ///---------------新加------------------------ editorMenu.deleteBtn.onClick.AddListener(() => { DeleteFunction(); editorMenu.gameObject.SetActive(false); }); PatternChoose.Inst.sb_xz_page.transform.Find("删除").GetComponent