Exemple #1
0
        private void OnExtractFileSavePathSelected(ArchiveFile archive, string fileName, string destPath)
        {
            interactable = true;
            try
            {
                if (Path.GetExtension(fileName).ToLowerInvariant() == ".bmp")
                {
                    // Special processing to convert tileset to a standard bmp format
                    BitmapFile bitmapFile = TilesetLoader.ReadTileset(archive.ExtractFileToMemory(fileName));
                    bitmapFile.Serialize(destPath);
                }
                else
                {
                    archive.ExtractFile(fileName, destPath);
                }
            }
            finally
            {
                archive.Dispose();
            }

            Debug.Log(Path.GetFileName(destPath) + " extracted successfully.");
        }