YanCheng_Metrology/Assets/Scripts/Project/UI/UI_Panel/UI_SelectDevicePanel.cs

36 lines
1.0 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class UI_SelectDevicePanel : BasePanel
{
private List<TB_Scheme> allSchemeName;
private Dictionary<int, TB_DeviceType> allDeviceTypes;
public void Init()
{
allSchemeName = GameManager.DataMgr.GetAllSchemeName();
allDeviceTypes = GameManager.DataMgr.GetAllDeviceTypes();
CreatItem();
}
void CreatItem()
{
var onlyDeviceHashSet = new HashSet<int>();
foreach (var scheme in allSchemeName)
{
if (!onlyDeviceHashSet.Contains(scheme.deviceTypeId))
{
onlyDeviceHashSet.Add(scheme.deviceTypeId);
var titleItem= GameManager.ResourcesMgr.Load<GameObject>(Const.UI_Item + "UI_SelectDevicePanel/titleItem");
titleItem.transform.parent = GetControl<ScrollRect>("DeviceScrollView").content;
}
}
}
}