コード例 #1
0
        public static void CompressDirectory(string source, string destination)
        {
            // delete any files that exist
            PlattarExporterOptions.DeleteFile(destination + ZipExtension);

            // Compress a folder.
            ZipFile.CreateFromDirectory(source, destination + ZipExtension);
        }
コード例 #2
0
 public static void CompressDirectory(string source, string destination)
 {
     // delete any files that exist
     PlattarExporterOptions.DeleteFile(destination + ZipExtension);
     // Compress a folder.
     using (ZipFile zip = new ZipFile()) {
         zip.AddDirectory(source);
         zip.Save(destination + ZipExtension);
     }
 }
コード例 #3
0
        /**
         * Generate the GLTF file and zip it all up
         */
        public static Tuple <string, string, string> GenerateGLTFZipped(GameObject selectedObject)
        {
            var path = GenerateGLTF(selectedObject);

            if (path == null)
            {
                return(path);
            }

            // otherwise, we need to zip up the entire directory
            // and delete the original
            PlattarExporterOptions.CompressDirectory(path.Item2, path.Item1 + "/" + path.Item3);
            PlattarExporterOptions.DeleteDirectory(path.Item2);

            return(path);
        }
コード例 #4
0
        public static void DeleteDirectory(string target_dir)
        {
            string[] files = Directory.GetFiles(target_dir);
            string[] dirs  = Directory.GetDirectories(target_dir);

            foreach (string file in files)
            {
                PlattarExporterOptions.DeleteFile(file);
            }

            foreach (string dir in dirs)
            {
                DeleteDirectory(dir);
            }

            Directory.Delete(target_dir, false);
        }