示例#1
0
        private void DrawIgnoredPatterns(NodeGUI node, Action onValueChanged)
        {
            var changed = false;

            using (new EditorGUILayout.VerticalScope(GUI.skin.box)) {
                GUILayout.Label("Files & Directory Ignore Settings");
                IgnorePattern removingItem = null;
                foreach (var p in m_ignorePatterns)
                {
                    using (new GUILayout.HorizontalScope()) {
                        if (GUILayout.Button("-", GUILayout.Width(30)))
                        {
                            removingItem = p;
                        }
                        EditorGUI.BeginChangeCheck();
                        p.OnGUI(node);
                        if (EditorGUI.EndChangeCheck())
                        {
                            changed = true;
                        }
                    }
                }
                if (removingItem != null)
                {
                    m_ignorePatterns.Remove(removingItem);
                    changed = true;
                }
                if (GUILayout.Button("+"))
                {
                    m_ignorePatterns.Add(new IgnorePattern(IgnorePattern.FileTypeMask.File, string.Empty));
                    changed = true;
                }
            }
            if (changed && onValueChanged != null)
            {
                using (new RecordUndoScope("Ignored Patterns Changed", node, true)) {
                    onValueChanged();
                }
            }
        }
示例#2
0
 public IgnorePattern(IgnorePattern p)
 {
     m_fileTypeMask  = p.m_fileTypeMask;
     m_ignorePattern = p.m_ignorePattern;
 }