void OnGUI()
        {
            GUILayout.Label("Bulk Prefab Replacer", EditorStyles.boldLabel);

            EditorGUILayout.HelpBox("Bulk Replace prefabs in your theme node based on a rule.  Backup your theme file before proceeding", MessageType.Info);

            GUI.changed = false;
            ruleType    = (BulkPrefabReplacementRuleType)EditorGUILayout.EnumPopup("Replacement Rule:", ruleType);
            if (ruleProcessor == null || GUI.changed)
            {
                ruleProcessor = BulkPrefabReplaceRuleFactory.CreateProcessor(ruleType);
            }

            BeginIndent();

            EditorGUILayout.HelpBox(GetRuleDescription(ruleType), MessageType.None);

            if (ruleProcessor != null)
            {
                ruleProcessor.DrawGUI();
                if (GUILayout.Button("Bulk Replace"))
                {
                    var  replacements = ruleProcessor.Process(graphEditor);
                    bool replaced     = PerformReplacements(replacements);
                    if (replaced)
                    {
                        // Refresh the thumbnails
                        CommonThemeEditorTools.RefreshThumbnails(graphEditor);
                    }
                }
            }

            EndIndent();
        }
        static string GetRuleDescription(BulkPrefabReplacementRuleType ruleType)
        {
            switch (ruleType)
            {
            case BulkPrefabReplacementRuleType.Directory:
                return("Replaces with similar named prefabs found in the target directory for each visual graph node in the current theme graph.   Does nothing if not found. Directory path should start with Asset/...");

            default:
                return("");
            }
        }
        public static IBulkPrefabReplaceRuleProcessor CreateProcessor(BulkPrefabReplacementRuleType RuleType)
        {
            switch (RuleType)
            {
            case BulkPrefabReplacementRuleType.Directory:
                return(new DirectoryBulkPrefabReplaceRuleProcessor());

            default:
                return(null);
            }
        }