void OnGUI() { if (_centeredLabelStyle == null) { _centeredLabelStyle = new GUIStyle(); _centeredLabelStyle.alignment = TextAnchor.MiddleCenter; _centeredLabelStyle.normal.textColor = (EditorGUIUtility.isProSkin ? Color.white : Color.black); } GUILayout.Space(5); EditorGUI.BeginChangeCheck(); _ignoreNewSelections = EditorGUILayout.ToggleLeft(new GUIContent("Ignore New Selections (CTRL+ALT+S)"), _ignoreNewSelections); EditorGUILayout.LabelField("Visible Selections:", _centeredLabelStyle); _visibleElements = (EVisibleElements)GUILayout.Toolbar((int)_visibleElements, new string[] { "Any", "Active Scene", "Project" }); if (EditorGUI.EndChangeCheck()) { SavePreferences(); } _scrollPosition = EditorGUILayout.BeginScrollView(_scrollPosition); GUILayout.Space(5); bool shownClear = false; bool processingLocked = false; for (int i = _selectedObjects.Count - 1; i >= 0; --i) { if (_selectedObjects[i].locked == false) { if (processingLocked) { // First non-locked. so add Clear button shownClear = true; if (LayoutClearButton()) { break; } processingLocked = false; } } else { processingLocked = true; } LayoutItem(i, _selectedObjects[i]); } // If clear button hasn't shown above (ie: no locked items), show it below if (shownClear == false) { LayoutClearButton(); } EditorGUILayout.EndScrollView(); }
private void OnEnable() { _ignoreNewSelections = EditorPrefs.GetBool(_SELECTION_LOG_IGNORE_NEW_SELELCTIONS, false); _visibleElements = (EVisibleElements)EditorPrefs.GetInt(_SELECTION_LOG_VISIBLE_ITEMS, 0); }