Ejemplo n.º 1
0
 public void RedrawRadio()
 {
     if (isInit)
     {
         return;
     }
     sector.Radio    = (int)(RadioSlider.value * 100);
     RadioValue.text = sector.Radio.ToString();
     sector.ReDrawSector();
 }
Ejemplo n.º 2
0
    /// <summary>
    /// 播放下一个摄像头
    /// </summary>
    void PlayNextMonitroVideo()
    {
        Logger.Instance.WriteLog("播放下一个摄像监控");
        if (nextVideoIndex > 0)
        {
            GameObject lingxing = FindLingXing(FindDeviceInfo(MonitorIdList[nextVideoIndex - 1]).CameraTag);
            if (lingxing != null)
            {
                lingxing.SetActive(false);
            }
            MapPanel.GetComponent <DrawMap>().SetMapIconColor(FindDeviceInfo(MonitorIdList[nextVideoIndex - 1]).Id, Color.green);
        }

        if (monitorScope != null)
        {
            Destroy(monitorScope);
        }

        DeviceInfo dInfo     = FindDeviceInfo(MonitorIdList[nextVideoIndex]);
        GameObject lingxing2 = FindLingXing(dInfo.CameraTag);

        if (lingxing2 != null)
        {
            lingxing2.SetActive(true);
        }
        MapPanel.GetComponent <DrawMap>().SetMapIconColor(dInfo.Id, Color.red, true);

        Transform trans = FindMonitor(dInfo.CameraTag).transform;

        monitorScope = Instantiate(MonitorScopePrefab,
                                   new Vector3(trans.position.x, 0.2f, trans.position.z),
                                   Quaternion.Euler(0, 0, 0)) as GameObject;
        DrawSector ds = monitorScope.GetComponent <DrawSector>();

        ds.Scope  = int.Parse(dInfo.MonitorScope);
        ds.Radio  = int.Parse(dInfo.MonitorRadio);
        ds.Offset = int.Parse(dInfo.MonitorOffset);
        ds.ReDrawSector();

        //判断是否已经是最后一个摄像头
        bool isLast = false;

        if (nextVideoIndex == MonitorIdList.Length - 1)
        {
            isLast = true;
        }
        //判断指定的摄像头是否存在,如果存在着播放此摄像头的视频
        if (MonitorIdList.Length > nextVideoIndex)
        {
            PlayMonitorVideo(MonitorIdList[nextVideoIndex], PlayTimeList[nextVideoIndex], isLast);
            nextVideoIndex++;
        }
        else
        {
            nextVideoIndex = 0;
            VideoPatrolWindow.SetActive(false);
        }
    }