Esempio n. 1
0
        public static List <PrefabDataHolder> PrefabDataFromSelection(PrefabHierarchyTreeView treeView)
        {
            List <PrefabDataHolder> prefabDataList = new List <PrefabDataHolder>();

            foreach (var item in treeView.GetSelection())
            {
                prefabDataList.Add(treeView.treeModel.Find(item).prefabDataHolder);
            }

            return(prefabDataList);
        }
        public static PrefabDataHolder[] PrefabDataFromSelection(PrefabHierarchyTreeView treeView)
        {
            var selection = treeView.GetSelection();
            var treeList  = treeView.treeModel.m_Data.ToList();

            PrefabDataHolder[] prefabDataList = new PrefabDataHolder[selection.Count];
            Parallel.For(0, selection.Count, i =>
            {
                prefabDataList[i] = treeList.Find(x => x.id == selection.ElementAt(i)).prefabDataHolder;
            });
            return(prefabDataList);
        }