Пример #1
0
 public override void ExportBinary(IExportContainer container, Stream stream)
 {
     if (IsReadLoadType(container.Version))
     {
         if (FSBResource.CheckIntegrity(File))
         {
             byte[] data = FSBResource.GetContent(File);
             stream.Write(data, 0, data.Length);
         }
         else
         {
             Logger.Log(LogType.Warning, LogCategory.Export, $"Can't export '{ValidName}' because data can't be read from resources file '{FSBResource.Source}'");
         }
     }
     else
     {
         if (IsReadStreamingInfo(container.Version) && LoadType == AudioClipLoadType.Streaming && m_audioData == null)
         {
             if (StreamingInfo.CheckIntegrity(File))
             {
                 byte[] data = StreamingInfo.GetContent(File);
                 stream.Write(data, 0, data.Length);
             }
             else
             {
                 Logger.Log(LogType.Warning, LogCategory.Export, $"Can't export '{ValidName}' because resources file '{StreamingInfo.Path}' hasn't been found");
             }
         }
         else
         {
             stream.Write(m_audioData, 0, m_audioData.Length);
         }
     }
 }
Пример #2
0
 public IReadOnlyList <byte> GetAudioData()
 {
     if (IsReadLoadType(File.Version))
     {
         return(FSBResource.GetContent(File) ?? new byte[0]);
     }
     else
     {
         if (IsReadStreamingInfo(File.Version))
         {
             if (LoadType == AudioClipLoadType.Streaming)
             {
                 if (m_audioData == null)
                 {
                     return(StreamingInfo.GetContent(File) ?? new byte[0]);
                 }
             }
         }
         return(m_audioData);
     }
 }
Пример #3
0
 public IReadOnlyList <byte> GetAudioData()
 {
     if (HasLoadType(File.Version))
     {
         return(FSBResource.GetContent(File) ?? Array.Empty <byte>());
     }
     else
     {
         if (HasStreamingInfo(File.Version))
         {
             if (LoadType == AudioClipLoadType.Streaming)
             {
                 if (AudioData == null)
                 {
                     return(StreamingInfo.GetContent(File) ?? Array.Empty <byte>());
                 }
             }
         }
         return(AudioData);
     }
 }