public static WindowBase GenerateScreen(string filepath, string className, FlowLayoutWindowTypeTemplate template)
        {
            WindowBase instance = null;

            filepath = filepath.Replace("//", "/");

            var sourcepath = ADB.GetAssetPath(template);

            filepath = AssetDatabase.GenerateUniqueAssetPath(filepath);

            System.IO.File.Copy(sourcepath, filepath, true);
            ADB.Refresh();

            var source = ADB.LoadAssetAtPath(filepath, typeof(GameObject)) as GameObject;
            var prefab = source.GetComponent <WindowBase>();

            instance = UnityEditor.PrefabUtility.InstantiatePrefab(prefab) as WindowBase;

            var type = WindowUtilities.GetTypeFromAllAssemblies(className);

            instance = FlowDatabase.ReplaceComponents <FlowLayoutWindowTypeTemplate, WindowBase>(instance as FlowLayoutWindowTypeTemplate, type);

            FlowDatabase.SaveScreen(instance);

            GameObject.DestroyImmediate(instance.gameObject);
            instance = (ADB.LoadAssetAtPath(filepath, typeof(GameObject)) as GameObject).GetComponent <WindowBase>();

            return(instance);
        }