Add project files.
This commit is contained in:
48
AssetStudio/ObjectReader.cs
Normal file
48
AssetStudio/ObjectReader.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace AssetStudio
|
||||
{
|
||||
public class ObjectReader : EndianBinaryReader
|
||||
{
|
||||
public SerializedFile assetsFile;
|
||||
public long m_PathID;
|
||||
public long byteStart;
|
||||
public uint byteSize;
|
||||
public ClassIDType type;
|
||||
public SerializedType serializedType;
|
||||
public BuildTarget platform;
|
||||
public SerializedFileFormatVersion m_Version;
|
||||
|
||||
public int[] version => assetsFile.version;
|
||||
public BuildType buildType => assetsFile.buildType;
|
||||
|
||||
public ObjectReader(EndianBinaryReader reader, SerializedFile assetsFile, ObjectInfo objectInfo) : base(reader.BaseStream, reader.Endian)
|
||||
{
|
||||
this.assetsFile = assetsFile;
|
||||
Game = reader.Game;
|
||||
m_PathID = objectInfo.m_PathID;
|
||||
byteStart = objectInfo.byteStart;
|
||||
byteSize = objectInfo.byteSize;
|
||||
if (Enum.IsDefined(typeof(ClassIDType), objectInfo.classID))
|
||||
{
|
||||
type = (ClassIDType)objectInfo.classID;
|
||||
}
|
||||
else
|
||||
{
|
||||
type = ClassIDType.UnknownType;
|
||||
}
|
||||
serializedType = objectInfo.serializedType;
|
||||
platform = assetsFile.m_TargetPlatform;
|
||||
m_Version = assetsFile.header.m_Version;
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
Position = byteStart;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user