ME3Explorer.Unreal.Classes.WwiseStream.ImportFromFile C# (CSharp) Метод

ImportFromFile() публичный Метод

public ImportFromFile ( string path, string pathtoafc = "" ) : void
path string
pathtoafc string
Результат void
        public void ImportFromFile(string path, string pathtoafc = "")
        {
            if (FileName == "")
                return;
            if (pathtoafc != "")
            {
                if (File.Exists(pathtoafc + FileName + ".afc"))
                    ImportWav(pathtoafc + FileName + ".afc", path, DataOffset);
                else
                {
                    OpenFileDialog d = new OpenFileDialog();
                    d.Filter = FileName + ".afc|" + FileName + ".afc";
                    if (d.ShowDialog() == DialogResult.OK)
                        ImportWav(d.FileName, path, DataOffset);
                }
            }
            else
            {
                OpenFileDialog d = new OpenFileDialog();
                d.Filter = FileName + ".afc|" + FileName + ".afc";
                if (d.ShowDialog() == DialogResult.OK)
                    ImportWav(d.FileName, path, DataOffset);
            }
        }

Usage Example

Пример #1
0
 public void ImportSound()
 {
     if (listView1.SelectedItems.Count != 1 || pcc == null)
         return;
     ListViewItem item = listView1.SelectedItems[0];
     int index = Convert.ToInt32(item.Name);
     if (pcc.Exports[index].ClassName == "WwiseStream")
     {
         OpenFileDialog o = new OpenFileDialog();
         o.Filter = "Wwise wav (*.wav)|*.wav";
         if (o.ShowDialog() == DialogResult.OK)
         {
             w = new WwiseStream(pcc, pcc.Exports[index].Data);
             w.ImportFromFile(o.FileName, pathBIOGame, pathCooked);
             byte[] buff = new byte[w.memsize];
             for (int i = 0; i < w.memsize; i++)
                 buff[i] = w.memory[i];
             PCCObject.ExportEntry ent = pcc.Exports[index];
             ent.Data = buff;
             //pcc.ChangeExportEntry(index, CopyExport(ent));
             MessageBox.Show("Done.");
         }
     }
 }