示例#1
0
 protected override void WriteObject(AssetsWriter writer)
 {
     writer.Write(Name);
     //writer.Write(MeshData);
     writer.WriteArrayOf(SubMeshes, (o, w) => o.Write(w));
     BlendShapeData.Write(writer);
     writer.WriteArrayOf(BindPose, (o, w) => w.Write(o));
     writer.WriteArrayOf(BoneNameHashes, (o, w) => w.Write(o));
     writer.Write(RootBoneNameHash);
     writer.Write(MeshCompression);
     writer.Write(IsReadable);
     writer.Write(KeepVerticies);
     writer.Write(KeepIndicies);
     writer.AlignTo(4);
     writer.Write(IndexFormat);
     writer.WriteArray(IndexBuffer);
     writer.AlignTo(4);
     VertexData.Write(writer);
     CompressedMesh.Write(writer);
     LocalAABB.Write(writer);
     writer.Write(MeshUsageFlags);
     writer.WriteArray(BakedConvexCollisionMesh);
     writer.AlignTo(4);
     writer.WriteArray(BakedTriangleCollisionMesh);
     writer.AlignTo(4);
     writer.Write(MeshMetrics1);
     writer.Write(MeshMetrics2);
     StreamData.Write(writer);
 }
示例#2
0
        public override void ParseObject(AssetsReader reader)
        {
            int startPosition = reader.Position;

            Name = reader.ReadString();
            //int readLen = ObjectInfo.DataSize - (reader.Position - startPosition);
            //MeshData = reader.ReadBytes(readLen);
            SubMeshes        = reader.ReadArrayOf(r => new Submesh(r));
            BlendShapeData   = new BlendShapeData(reader);
            BindPose         = reader.ReadArrayOf(r => reader.ReadSingle());
            BoneNameHashes   = reader.ReadArrayOf(r => r.ReadUInt32());
            RootBoneNameHash = reader.ReadUInt32();
            MeshCompression  = reader.ReadByte();
            IsReadable       = reader.ReadBoolean();
            KeepVerticies    = reader.ReadBoolean();
            KeepIndicies     = reader.ReadBoolean();
            reader.AlignTo(4);
            IndexFormat = reader.ReadInt32();
            IndexBuffer = reader.ReadArray();
            reader.AlignTo(4);
            VertexData               = new VertexData(reader);
            CompressedMesh           = new CompressedMesh(reader);
            LocalAABB                = new AABB(reader);
            MeshUsageFlags           = reader.ReadInt32();
            BakedConvexCollisionMesh = reader.ReadArray();
            reader.AlignTo(4);
            BakedTriangleCollisionMesh = reader.ReadArray();
            reader.AlignTo(4);
            MeshMetrics1 = reader.ReadSingle();
            MeshMetrics2 = reader.ReadSingle();
            StreamData   = new StreamingInfo(reader);
        }