private static void JJJ(StationMgr stationMgr, DeviceMgr deviceMgr, Transform deviceTypeTrans, System.UInt16 stationIndex, DeviceType deviceType) { int deviceCount = deviceTypeTrans.childCount; for (int i = 0; i < deviceCount; ++i) { Transform deviceTrans = deviceTypeTrans.GetChild(i); string deviceName = deviceTrans.gameObject.name; Device deviceCom = deviceTrans.GetComponent <Device> (); if (deviceCom == null) { continue; } deviceCom.DeviceId = (int)deviceType + i + 1; deviceCom.StationIndex = stationIndex; deviceCom.DeviceType = deviceType; deviceMgr.AddDevice(deviceCom); OneStation station = TDFramework.SingletonMgr.GameGlobalInfo.StationDeviceAndPointInfo.GetStation(stationIndex); // deviceType, deviceName PointBindInfoList list = station.GetPointBindInfoList(deviceType, deviceName); int pointCount = list.m_pointBindInfoList.Count; for (int j = 0; j < pointCount; ++j) { PointBindInfo pointBindInfo = list.m_pointBindInfoList[j]; int pointStatus = (int)System.Enum.Parse(typeof(PointStatus), pointBindInfo.m_name); int queueIndex = pointBindInfo.m_queueIndex; Point point = GetFirstPoint(stationMgr, stationIndex, pointStatus, queueIndex); point.m_device = deviceCom; } #region 设备是屏蔽门,需管理上行和下行屏蔽门 if (deviceCom is PingBiMenDevice) { PingBiMenMgr pingBiMenMgr = (PingBiMenMgr)deviceMgr; PingBiMenDevice device = (PingBiMenDevice)deviceCom; if (device.PingBiMenType == PingBiMenType.Down) { //下行屏蔽门 pingBiMenMgr.AddDevice2XiaXingPingBiMenList(deviceCom); } else if (device.PingBiMenType == PingBiMenType.Up) { //上行屏蔽门 pingBiMenMgr.AddDevice2ShangXingPingBiMenList(deviceCom); } } #endregion } }