Exemple #1
0
        private async void BtnExportRaw_Click(object?sender, Avalonia.Interactivity.RoutedEventArgs e)
        {
            if (await FailIfNothingSelected())
            {
                return;
            }

            SaveFileDialog sfd = new SaveFileDialog();

            sfd.Title   = "Save As";
            sfd.Filters = new List <FileDialogFilter>()
            {
                new FileDialogFilter()
                {
                    Name = "Raw Unity Asset", Extensions = new List <string>()
                    {
                        "dat"
                    }
                }
            };
            string file = await sfd.ShowAsync(this);

            if (file != null && file != string.Empty)
            {
                using (FileStream fs = File.OpenWrite(file))
                {
                    AssetImportExport dumper = new AssetImportExport();
                    dumper.DumpRawAsset(fs, assetsFile.file, GetSelectedInfo());
                }
            }
        }