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; }
public void AssetLabelsChangedForObject(Object asset) { if (!m_IgnoreNextAssetLabelsChangedCall && m_CurrentAssetsSet != null && m_CurrentAssetsSet.Contains(asset)) { m_AssetLabels = null; // someone else changed the labels for one of our selected assets, so invalidate cache } m_IgnoreNextAssetLabelsChangedCall = false; }
public void AssetLabelsChangedForObject(UnityEngine.Object asset) { if (!this.m_IgnoreNextAssetLabelsChangedCall && this.m_CurrentAssetsSet != null && this.m_CurrentAssetsSet.Contains(asset)) { this.m_AssetLabels = null; } this.m_IgnoreNextAssetLabelsChangedCall = false; }
public PopupList(PopupList.InputData inputData, string initialSelectionLabel) { this.m_Data = inputData; this.m_Data.ResetScores(); this.SelectNoCompletion(); this.m_Gravity = PopupList.Gravity.Top; if (initialSelectionLabel == null) return; this.m_EnteredTextCompletion = initialSelectionLabel; this.UpdateCompletion(); }
public PopupList(PopupList.InputData inputData, string initialSelectionLabel) { this.m_Data = inputData; this.m_Data.ResetScores(); this.SelectNoCompletion(); this.m_Gravity = PopupList.Gravity.Top; if (initialSelectionLabel != null) { this.m_EnteredTextCompletion = initialSelectionLabel; this.UpdateCompletion(); } }
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; }
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; }
public void InvalidateLabels() { this.m_AssetLabels = null; this.m_CurrentAssetsSet = null; }
public PopupList(PopupList.InputData inputData) : this(inputData, null) { }
private void SetupAssetLabelList() { Dictionary<string, float> allLabels = AssetDatabase.GetAllLabels(); this.m_AssetLabels = new PopupList.InputData(); this.m_AssetLabels.m_CloseOnSelection = false; this.m_AssetLabels.m_AllowCustom = true; this.m_AssetLabels.m_OnSelectCallback = new PopupList.OnSelectCallback(this.AssetLabelListCallback); this.m_AssetLabels.m_MaxCount = 15; this.m_AssetLabels.m_SortAlphabetically = true; using (Dictionary<string, float>.Enumerator enumerator = allLabels.GetEnumerator()) { while (enumerator.MoveNext()) { KeyValuePair<string, float> current = enumerator.Current; PopupList.ListElement listElement = this.m_AssetLabels.NewOrMatchingElement(current.Key); if ((double) listElement.filterScore < (double) current.Value) listElement.filterScore = current.Value; } } }
public void AssetLabelsChangedForObject(UnityEngine.Object asset) { if (!this.m_IgnoreNextAssetLabelsChangedCall && this.m_CurrentAssetsSet != null && this.m_CurrentAssetsSet.Contains(asset)) this.m_AssetLabels = (PopupList.InputData) null; this.m_IgnoreNextAssetLabelsChangedCall = false; }
public PopupList(PopupList.InputData inputData) : this(inputData, (string)null) { }
private void SetupAssetLabelList() { Dictionary<string, float> allLabels = AssetDatabase.GetAllLabels(); this.m_AssetLabels = new PopupList.InputData(); this.m_AssetLabels.m_CloseOnSelection = false; this.m_AssetLabels.m_AllowCustom = true; this.m_AssetLabels.m_OnSelectCallback = new PopupList.OnSelectCallback(this.AssetLabelListCallback); this.m_AssetLabels.m_MaxCount = 15; this.m_AssetLabels.m_SortAlphabetically = true; foreach (KeyValuePair<string, float> current in allLabels) { PopupList.ListElement listElement = this.m_AssetLabels.NewOrMatchingElement(current.Key); if (listElement.filterScore < current.Value) { listElement.filterScore = current.Value; } } }
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; }
private void SetupDroplists() { this.SetupAssetLabelList(); this.m_ObjectTypes = new PopupList.InputData(); this.m_ObjectTypes.m_CloseOnSelection = false; this.m_ObjectTypes.m_AllowCustom = false; this.m_ObjectTypes.m_OnSelectCallback = new PopupList.OnSelectCallback(this.TypeListCallback); this.m_ObjectTypes.m_SortAlphabetically = false; this.m_ObjectTypes.m_MaxCount = 0; string[] typesDisplayNames = this.GetTypesDisplayNames(); for (int index = 0; index < typesDisplayNames.Length; ++index) { PopupList.ListElement listElement = this.m_ObjectTypes.NewOrMatchingElement(typesDisplayNames[index]); if (index == 0) listElement.selected = true; } }
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; }