Ejemplo n.º 1
0
 public void ExtractAll(string path)
 {
     foreach (KeyValuePair <string, ZFSFileInfo> zfsFileInfo in _files)
     {
         using (FastBinaryReader stream = GetDataStream(zfsFileInfo.Value))
         {
             byte[] buf = stream.ReadBytes((int)zfsFileInfo.Value.Length);
             File.WriteAllBytes(Path.Combine(path, zfsFileInfo.Value.Filename), buf);
         }
     }
 }
Ejemplo n.º 2
0
        public AudioClip GetAudioClip(string filename)
        {
            if (!_files.TryGetValue(filename.ToLower(), out ZFSFileInfo fileInfo))
            {
                Debug.Log("File '" + filename + "' does not exist.");
                return(null);
            }

            using (FastBinaryReader reader = GetFileStream(filename))
            {
                byte[] data = reader.ReadBytes((int)(reader.Length - reader.Position));
                return(WavUtility.ToAudioClip(data, filename));
            }
        }