(Unity): implemented 'resources.assets' archives.

This commit is contained in:
morkt
2017-12-15 01:16:16 +04:00
parent 59924e0285
commit f071bef660
4 changed files with 287 additions and 4 deletions

View File

@@ -124,7 +124,6 @@ namespace GameRes.Formats.Unity
Trace.WriteLine ("Unknown type id", obj.ClassId.ToString());
m_types[obj.TypeId] = null;
}
throw new ApplicationException (string.Format ("Unknwon type id {0}", obj.ClassId));
}
if (m_objects.ContainsKey (obj.PathId))
throw new ApplicationException (string.Format ("Duplicate asset object {0} (PathId: {1})", obj, obj.PathId));
@@ -390,6 +389,7 @@ namespace GameRes.Formats.Unity
internal class AudioClip
{
public string m_Name;
public int m_LoadType;
public int m_Channels;
public int m_Frequency;
@@ -407,7 +407,7 @@ namespace GameRes.Formats.Unity
public void Load (AssetReader reader)
{
var name = reader.ReadString();
m_Name = reader.ReadString();
reader.Align();
m_LoadType = reader.ReadInt32();
m_Channels = reader.ReadInt32();
@@ -428,4 +428,18 @@ namespace GameRes.Formats.Unity
m_CompressionFormat = reader.ReadInt32();
}
}
internal class StreamingInfo
{
public uint Offset;
public uint Size;
public string Path;
public void Load (AssetReader reader)
{
Offset = reader.ReadUInt32();
Size = reader.ReadUInt32();
Path = reader.ReadString();
}
}
}