Exemple #1
0
        public void InitLabelCache(UnityEngine.Object[] assets)
        {
            HashSet <UnityEngine.Object> hashSet = new HashSet <UnityEngine.Object>(assets);

            if (this.m_CurrentAssetsSet == null || !this.m_CurrentAssetsSet.SetEquals(hashSet))
            {
                List <string> source;
                List <string> source2;
                this.GetLabelsForAssets(assets, out source, out source2);
                this.m_AssetLabels = new PopupList.InputData
                {
                    m_AllowCustom        = true,
                    m_OnSelectCallback   = new PopupList.OnSelectCallback(this.AssetLabelListCallback),
                    m_MaxCount           = 15,
                    m_SortAlphabetically = true
                };
                Dictionary <string, float> allLabels = AssetDatabase.GetAllLabels();
                foreach (KeyValuePair <string, float> pair in allLabels)
                {
                    PopupList.ListElement listElement = this.m_AssetLabels.NewOrMatchingElement(pair.Key);
                    if (listElement.filterScore < pair.Value)
                    {
                        listElement.filterScore = pair.Value;
                    }
                    listElement.selected          = source.Any((string label) => string.Equals(label, pair.Key, StringComparison.OrdinalIgnoreCase));
                    listElement.partiallySelected = source2.Any((string label) => string.Equals(label, pair.Key, StringComparison.OrdinalIgnoreCase));
                }
            }
            this.m_CurrentAssetsSet = hashSet;
            this.m_CurrentChanged   = false;
        }
Exemple #2
0
        public void InitLabelCache(UnityEngine.Object[] assets)
        {
            HashSet <UnityEngine.Object> objectSet = new HashSet <UnityEngine.Object>((IEnumerable <UnityEngine.Object>)assets);

            if (this.m_CurrentAssetsSet == null || !this.m_CurrentAssetsSet.SetEquals((IEnumerable <UnityEngine.Object>)objectSet))
            {
                List <string> all;
                List <string> partial;
                this.GetLabelsForAssets(assets, out all, out partial);
                this.m_AssetLabels = new PopupList.InputData()
                {
                    m_CloseOnSelection   = false,
                    m_AllowCustom        = true,
                    m_OnSelectCallback   = new PopupList.OnSelectCallback(this.AssetLabelListCallback),
                    m_MaxCount           = 15,
                    m_SortAlphabetically = true
                };
                Dictionary <string, float> allLabels = AssetDatabase.GetAllLabels();
                // ISSUE: object of a compiler-generated type is created
                // ISSUE: variable of a compiler-generated type
                LabelGUI.\u003CInitLabelCache\u003Ec__AnonStorey92 cacheCAnonStorey92 = new LabelGUI.\u003CInitLabelCache\u003Ec__AnonStorey92();
                using (Dictionary <string, float> .Enumerator enumerator = allLabels.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        // ISSUE: reference to a compiler-generated field
                        cacheCAnonStorey92.pair = enumerator.Current;
                        // ISSUE: reference to a compiler-generated field
                        PopupList.ListElement listElement = this.m_AssetLabels.NewOrMatchingElement(cacheCAnonStorey92.pair.Key);
                        // ISSUE: reference to a compiler-generated field
                        if ((double)listElement.filterScore < (double)cacheCAnonStorey92.pair.Value)
                        {
                            // ISSUE: reference to a compiler-generated field
                            listElement.filterScore = cacheCAnonStorey92.pair.Value;
                        }
                        // ISSUE: reference to a compiler-generated method
                        listElement.selected = all.Any <string>(new Func <string, bool>(cacheCAnonStorey92.\u003C\u003Em__164));
                        // ISSUE: reference to a compiler-generated method
                        listElement.partiallySelected = partial.Any <string>(new Func <string, bool>(cacheCAnonStorey92.\u003C\u003Em__165));
                    }
                }
            }
            this.m_CurrentAssetsSet = objectSet;
            this.m_CurrentChanged   = false;
        }
Exemple #3
0
        public void InitLabelCache(Object[] assets)
        {
            HashSet <Object> newAssetSet = new HashSet <Object>(assets);

            // Init only if new asset
            if (m_CurrentAssetsSet == null || !m_CurrentAssetsSet.SetEquals(newAssetSet))
            {
                List <string> all;
                List <string> partial;
                GetLabelsForAssets(assets, out all, out partial);

                m_AssetLabels = new PopupList.InputData
                {
                    m_CloseOnSelection   = false,
                    m_AllowCustom        = true,
                    m_OnSelectCallback   = AssetLabelListCallback,
                    m_MaxCount           = 15,
                    m_SortAlphabetically = true
                };

                Dictionary <string, float> allLabels = AssetDatabase.GetAllLabels();
                foreach (var pair in allLabels)
                {
                    PopupList.ListElement element = m_AssetLabels.NewOrMatchingElement(pair.Key);
                    if (element.filterScore < pair.Value)
                    {
                        element.filterScore = pair.Value;
                    }
                    element.selected          = all.Any(label => string.Equals(label, pair.Key, StringComparison.OrdinalIgnoreCase));
                    element.partiallySelected = partial.Any(label => string.Equals(label, pair.Key, StringComparison.OrdinalIgnoreCase));
                }
            }

            m_CurrentAssetsSet = newAssetSet;
            m_CurrentChanged   = false;
        }