mirror of
https://github.com/aelurum/AssetStudio.git
synced 2025-07-22 03:54:16 -04:00
improve
This commit is contained in:
@ -527,14 +527,13 @@ namespace AssetStudio
|
||||
public List<StreamedFrame> ReadData()
|
||||
{
|
||||
var frameList = new List<StreamedFrame>();
|
||||
using (Stream stream = new MemoryStream())
|
||||
var buffer = new byte[data.Length * 4];
|
||||
Buffer.BlockCopy(data, 0, buffer, 0, buffer.Length);
|
||||
using (var reader = new BinaryReader(new MemoryStream(buffer)))
|
||||
{
|
||||
BinaryWriter writer = new BinaryWriter(stream);
|
||||
writer.Write(data);
|
||||
stream.Position = 0;
|
||||
while (stream.Position < stream.Length)
|
||||
while (reader.BaseStream.Position < reader.BaseStream.Length)
|
||||
{
|
||||
frameList.Add(new StreamedFrame(new BinaryReader(stream)));
|
||||
frameList.Add(new StreamedFrame(reader));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5,22 +5,32 @@ using System.Text;
|
||||
|
||||
namespace AssetStudio
|
||||
{
|
||||
public class AnimationClipOverride
|
||||
{
|
||||
public PPtr m_OriginalClip;
|
||||
public PPtr m_OverrideClip;
|
||||
|
||||
public AnimationClipOverride(ObjectReader reader)
|
||||
{
|
||||
m_OriginalClip = reader.ReadPPtr();
|
||||
m_OverrideClip = reader.ReadPPtr();
|
||||
}
|
||||
}
|
||||
|
||||
public class AnimatorOverrideController : NamedObject
|
||||
{
|
||||
public PPtr m_Controller;
|
||||
public PPtr[][] m_Clips;
|
||||
public List<AnimationClipOverride> m_Clips;
|
||||
|
||||
public AnimatorOverrideController(ObjectReader reader) : base(reader)
|
||||
{
|
||||
m_Controller = reader.ReadPPtr();
|
||||
|
||||
int numOverrides = reader.ReadInt32();
|
||||
m_Clips = new PPtr[numOverrides][];
|
||||
m_Clips = new List<AnimationClipOverride>(numOverrides);
|
||||
for (int i = 0; i < numOverrides; i++)
|
||||
{
|
||||
m_Clips[i] = new PPtr[2];
|
||||
m_Clips[i][0] = reader.ReadPPtr();
|
||||
m_Clips[i][1] = reader.ReadPPtr();
|
||||
m_Clips.Add(new AnimationClipOverride(reader));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,41 +5,39 @@ using System.Text;
|
||||
|
||||
namespace AssetStudio
|
||||
{
|
||||
public class AssetInfo
|
||||
{
|
||||
public int preloadIndex;
|
||||
public int preloadSize;
|
||||
public PPtr asset;
|
||||
|
||||
public AssetInfo(ObjectReader reader)
|
||||
{
|
||||
preloadIndex = reader.ReadInt32();
|
||||
preloadSize = reader.ReadInt32();
|
||||
asset = reader.ReadPPtr();
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class AssetBundle : NamedObject
|
||||
{
|
||||
public class AssetInfo
|
||||
{
|
||||
public int preloadIndex;
|
||||
public int preloadSize;
|
||||
public PPtr asset;
|
||||
}
|
||||
|
||||
public class ContainerData
|
||||
{
|
||||
public string first;
|
||||
public AssetInfo second;
|
||||
}
|
||||
|
||||
public List<ContainerData> m_Container = new List<ContainerData>();
|
||||
public List<PPtr> m_PreloadTable;
|
||||
public List<KeyValuePair<string, AssetInfo>> m_Container;
|
||||
|
||||
public AssetBundle(ObjectReader reader) : base(reader)
|
||||
{
|
||||
var size = reader.ReadInt32();
|
||||
for (int i = 0; i < size; i++)
|
||||
var m_PreloadTableSize = reader.ReadInt32();
|
||||
m_PreloadTable = new List<PPtr>(m_PreloadTableSize);
|
||||
for (int i = 0; i < m_PreloadTableSize; i++)
|
||||
{
|
||||
reader.ReadPPtr();
|
||||
m_PreloadTable.Add(reader.ReadPPtr());
|
||||
}
|
||||
size = reader.ReadInt32();
|
||||
for (int i = 0; i < size; i++)
|
||||
|
||||
var m_ContainerSize = reader.ReadInt32();
|
||||
m_Container = new List<KeyValuePair<string, AssetInfo>>(m_ContainerSize);
|
||||
for (int i = 0; i < m_ContainerSize; i++)
|
||||
{
|
||||
var temp = new ContainerData();
|
||||
temp.first = reader.ReadAlignedString();
|
||||
temp.second = new AssetInfo();
|
||||
temp.second.preloadIndex = reader.ReadInt32();
|
||||
temp.second.preloadSize = reader.ReadInt32();
|
||||
temp.second.asset = reader.ReadPPtr();
|
||||
m_Container.Add(temp);
|
||||
m_Container.Add(new KeyValuePair<string, AssetInfo>(reader.ReadAlignedString(), new AssetInfo(reader)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -110,7 +110,7 @@ namespace AssetStudio
|
||||
{1057, "int2_storage"},
|
||||
{1070, "int3_storage"},
|
||||
{1083, "BoundsInt"},
|
||||
{1092, "m_CorrespondingSourceObject"}
|
||||
{1093, "m_CorrespondingSourceObject"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -14,11 +14,6 @@ namespace AssetStudio
|
||||
}
|
||||
}
|
||||
|
||||
public static void Write(this BinaryWriter writer, uint[] array)
|
||||
{
|
||||
WriteArray(writer.Write, array);
|
||||
}
|
||||
|
||||
public static void AlignStream(this BinaryWriter writer, int alignment)
|
||||
{
|
||||
var pos = writer.BaseStream.Position;
|
||||
|
Reference in New Issue
Block a user