public static int ParseBuildData(KBatchGroupData data, KAnimHashedString fileNameHash, FastReader reader, List <Texture2D> textures)
    {
        CheckHeader("BILD", reader);
        int num = reader.ReadInt32();

        if (num != 10 && num != 9)
        {
            Debug.LogError(fileNameHash + " has invalid build.bytes version [" + num + "]");
            return(-1);
        }
        KAnimGroupFile.Group group = KAnimGroupFile.GetGroup(data.groupID);
        if (group == null)
        {
            Debug.LogErrorFormat("[{1}] Failed to get group [{0}]", data.groupID, fileNameHash.DebuggerDisplay);
        }
        KAnim.Build build = null;
        int         num2  = reader.ReadInt32();
        int         num3  = reader.ReadInt32();

        build = data.AddNewBuildFile(fileNameHash);
        build.textureCount = textures.Count;
        if (textures.Count > 0)
        {
            data.AddTextures(textures);
        }
        build.symbols  = new KAnim.Build.Symbol[num2];
        build.frames   = new KAnim.Build.SymbolFrame[num3];
        build.name     = reader.ReadKleiString();
        build.batchTag = ((!group.swapTarget.IsValid) ? data.groupID : group.target);
        build.fileHash = fileNameHash;
        int num4 = 0;

        for (int i = 0; i < build.symbols.Length; i++)
        {
            KAnimHashedString  hash   = new KAnimHashedString(reader.ReadInt32());
            KAnim.Build.Symbol symbol = new KAnim.Build.Symbol();
            symbol.build = build;
            symbol.hash  = hash;
            if (num > 9)
            {
                symbol.path = new KAnimHashedString(reader.ReadInt32());
            }
            symbol.colourChannel            = new KAnimHashedString(reader.ReadInt32());
            symbol.flags                    = reader.ReadInt32();
            symbol.firstFrameIdx            = data.symbolFrameInstances.Count;
            symbol.numFrames                = reader.ReadInt32();
            symbol.symbolIndexInSourceBuild = i;
            int num5 = 0;
            for (int j = 0; j < symbol.numFrames; j++)
            {
                KAnim.Build.SymbolFrame         symbolFrame = new KAnim.Build.SymbolFrame();
                KAnim.Build.SymbolFrameInstance item        = default(KAnim.Build.SymbolFrameInstance);
                item.symbolFrame           = symbolFrame;
                symbolFrame.fileNameHash   = fileNameHash;
                symbolFrame.sourceFrameNum = reader.ReadInt32();
                symbolFrame.duration       = reader.ReadInt32();
                item.buildImageIdx         = data.textureStartIndex[fileNameHash] + reader.ReadInt32();
                if (item.buildImageIdx >= textures.Count + data.textureStartIndex[fileNameHash])
                {
                    Debug.LogErrorFormat("{0} Symbol: [{1}] tex count: [{2}] buildImageIdx: [{3}] group total [{4}]", fileNameHash.ToString(), symbol.hash, textures.Count, item.buildImageIdx, data.textureStartIndex[fileNameHash]);
                }
                item.symbolIdx = data.GetSymbolCount();
                num5           = Math.Max(symbolFrame.sourceFrameNum + symbolFrame.duration, num5);
                float num6 = reader.ReadSingle();
                float num7 = reader.ReadSingle();
                float num8 = reader.ReadSingle();
                float num9 = reader.ReadSingle();
                symbolFrame.bboxMin = new Vector2(num6 - num8 * 0.5f, num7 - num9 * 0.5f);
                symbolFrame.bboxMax = new Vector2(num6 + num8 * 0.5f, num7 + num9 * 0.5f);
                float x     = reader.ReadSingle();
                float num10 = reader.ReadSingle();
                float x2    = reader.ReadSingle();
                float num11 = reader.ReadSingle();
                symbolFrame.uvMin  = new Vector2(x, 1f - num10);
                symbolFrame.uvMax  = new Vector2(x2, 1f - num11);
                build.frames[num4] = symbolFrame;
                data.symbolFrameInstances.Add(item);
                num4++;
            }
            symbol.numLookupFrames = num5;
            data.AddBuildSymbol(symbol);
            build.symbols[i] = symbol;
        }
        ParseHashTable(reader);
        return(build.index);
    }