示例#1
0
 public string Dump()
 {
     reader.Reset();
     if (serializedType?.m_Nodes != null)
     {
         var sb = new StringBuilder();
         TypeTreeHelper.ReadTypeString(sb, serializedType.m_Nodes, reader);
         return(sb.ToString());
     }
     return(null);
 }
示例#2
0
        protected Object(ObjectReader reader)
        {
            this.reader = reader;
            reader.Reset();
            sourceFile = reader.assetsFile;
            version    = reader.version;
            buildType  = reader.buildType;
            platform   = reader.platform;

            if (platform == BuildTarget.NoTarget)
            {
                var m_ObjectHideFlags = reader.ReadUInt32();
            }
        }
示例#3
0
        public static void ReadTypeString(StringBuilder sb, List <TypeTreeNode> members, ObjectReader reader)
        {
            reader.Reset();
            for (int i = 0; i < members.Count; i++)
            {
                ReadStringValue(sb, members, reader, ref i);
            }
            var readed = reader.Position - reader.byteStart;

            if (readed != reader.byteSize)
            {
                Logger.Error($"Error while read type, read {readed} bytes but expected {reader.byteSize} bytes");
            }
        }
示例#4
0
        public Object(ObjectReader reader)
        {
            this.reader = reader;
            reader.Reset();
            assetsFile     = reader.assetsFile;
            type           = reader.type;
            m_PathID       = reader.m_PathID;
            version        = reader.version;
            buildType      = reader.buildType;
            platform       = reader.platform;
            serializedType = reader.serializedType;
            byteSize       = reader.byteSize;

            if (platform == BuildTarget.NoTarget)
            {
                var m_ObjectHideFlags = reader.ReadUInt32();
            }
        }
示例#5
0
        public static string ReadTypeString(TypeTree m_Type, ObjectReader reader)
        {
            reader.Reset();
            var sb      = new StringBuilder();
            var m_Nodes = m_Type.m_Nodes;

            for (int i = 0; i < m_Nodes.Count; i++)
            {
                ReadStringValue(sb, m_Nodes, reader, ref i);
            }
            var readed = reader.Position - reader.byteStart;

            if (readed != reader.byteSize)
            {
                Logger.Info($"Error while read type, read {readed} bytes but expected {reader.byteSize} bytes");
            }
            return(sb.ToString());
        }
示例#6
0
        public static OrderedDictionary ReadType(List <TypeTreeNode> members, ObjectReader reader)
        {
            reader.Reset();
            var obj = new OrderedDictionary();

            for (int i = 1; i < members.Count; i++)
            {
                var member     = members[i];
                var varNameStr = member.m_Name;
                obj[varNameStr] = ReadValue(members, reader, ref i);
            }
            var readed = reader.Position - reader.byteStart;

            if (readed != reader.byteSize)
            {
                Logger.Error($"Error while read type, read {readed} bytes but expected {reader.byteSize} bytes");
            }
            return(obj);
        }
示例#7
0
 public byte[] GetRawData()
 {
     reader.Reset();
     return(reader.ReadBytes((int)byteSize));
 }