Ejemplo n.º 1
0
 private void Select()
 {
     if (!Selected)
     {
         if (SelectedItem)
         {
             SelectedItem.Deselect();
         }
         Selected     = true;
         SelectedItem = this;
         Background.SetActive(true);
     }
 }
Ejemplo n.º 2
0
    /// <summary>
    /// 从数据库加载摄像头的信息
    /// </summary>
    /// <returns>The device info record.</returns>
    private void LoadDeviceInfoRecord()
    {
        Logger.Instance.WriteLog("加载摄像头的信息");
        DicMornitorInfos = new Dictionary <string, DeviceInfo>();
        DeviceDao dDao = new DeviceDao();

        dDao.Select001();
        if (dDao.Result.Count <= 0)
        {
            Logger.Instance.WriteLog("加载摄像头的信息失败");
            return;
        }
        for (int i = 0; i < dDao.Result.Count; i++)
        {
            DicMornitorInfos.Add(dDao.Result[i].Id, dDao.Result[i]);
            GameObject go = Instantiate(SelectMornitorItemPrefab) as GameObject;
            SelectMornitorList.AddChild(go.transform);
            go.transform.localScale = new Vector3(1, 1, 1);
            SelecteMornitorItem item = go.GetComponent <SelecteMornitorItem>();
            item.Init(dDao.Result[i]);
            item.BindAction(AddItemToSelectedMornitorList);
        }
    }