当前位置: 首页>>代码示例>>C#>>正文


C# SerializingContainer类代码示例

本文整理汇总了C#中SerializingContainer的典型用法代码示例。如果您正苦于以下问题:C# SerializingContainer类的具体用法?C# SerializingContainer怎么用?C# SerializingContainer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SerializingContainer类属于命名空间,在下文中一共展示了SerializingContainer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Serialize

 public void Serialize(SerializingContainer con)
 {
     v0 = con + v0;
     v1 = con + v1;
     v2 = con + v2;
     mat = con + mat;
 }
开发者ID:CreeperLava,项目名称:ME3Explorer,代码行数:7,代码来源:StaticMesh.cs

示例2: SerializeHeader

 void SerializeHeader(SerializingContainer Container)
 {
     if (Container.isLoading)
         header = new ME2HeaderStruct();
     header.Magic = Container + header.Magic;
     header.unk1 = Container + header.unk1;
     int count = 0;
     if (!Container.isLoading)
         count = header.Licensee.Length;
     else
         header.Licensee = "";
     header.Licensee = SerializeString(Container, header.Licensee);
     count = 0;
     if (!Container.isLoading)
         count = header.Project.Length;
     else
         header.Project = "";
     header.Project = SerializeString(Container, header.Project);
     header.unk3 = Container + header.unk3;
     header.unk4 = Container + header.unk4;
     count = 0;
     if (!Container.isLoading)
         count = header.Names.Length;
     count = Container + count;
     if (Container.isLoading)
         header.Names = new string[count];
     ushort unk = 0;
     for (int i = 0; i < count; i++)
     {
         unk = Container + unk;
         header.Names[i] = SerializeString(Container, header.Names[i]);
     }
 }
开发者ID:ME3Explorer,项目名称:ME3Explorer,代码行数:33,代码来源:ME2FaceFXAnimSet.cs

示例3: Serialize

 public void Serialize(SerializingContainer Container)
 {
     MaterialIndex = Container + MaterialIndex;
     ChunkIndex = Container + ChunkIndex;
     BaseIndex = Container + BaseIndex;
     NumTriangles = Container + NumTriangles;
     TriangleSorting = Container + TriangleSorting;
 }
开发者ID:ME3Explorer,项目名称:ME3Explorer,代码行数:8,代码来源:SkeletalMesh.cs

示例4: ME3FaceFXAnimSet

 public ME3FaceFXAnimSet(IMEPackage Pcc, IExportEntry Entry)
 {
     
     pcc = Pcc;
     export = Entry;
     List<PropertyReader.Property> props = PropertyReader.getPropList(export);
     int start = props[props.Count - 1].offend + 4;
     SerializingContainer Container = new SerializingContainer(new MemoryStream(export.Data.Skip(start).ToArray()));
     Container.isLoading = true;
     Serialize(Container);
 }
开发者ID:ME3Explorer,项目名称:ME3Explorer,代码行数:11,代码来源:ME3FaceFXAnimSet.cs

示例5: StaticMesh

 public StaticMesh(UDKObject udk, int Index)
 {
     MyIndex = Index;
     Owner = udk;
     int start = GetPropertyEnd(Index);
     byte[] buff = new byte[udk.Exports[Index].data.Length - start];
     for (int i = 0; i < udk.Exports[Index].data.Length - start; i++)
         buff[i] = udk.Exports[Index].data[i + start];
     MemoryStream m = new MemoryStream(buff);
     SerializingContainer Container = new SerializingContainer(m);
     Container.isLoading = true;
     Serialize(Container);
 }
开发者ID:CreeperLava,项目名称:ME3Explorer,代码行数:13,代码来源:StaticMesh.cs

示例6: SerializeHeader

 void SerializeHeader(SerializingContainer Container)
 {
     if (Container.isLoading)
         header = new ME3HeaderStruct();
     header.Magic = Container + header.Magic;
     header.unk1 = Container + header.unk1;
     header.unk2 = Container + header.unk2;
     int count = 0;
     if (!Container.isLoading)
         count = header.Licensee.Length;
     else
         header.Licensee = "";
     header.Licensee = SerializeString(Container, header.Licensee);
     count = 0;
     if (!Container.isLoading)
         count = header.Project.Length;
     else
         header.Project = "";
     header.Project = SerializeString(Container, header.Project);
     header.unk3 = Container + header.unk3;
     header.unk4 = Container + header.unk4;
     count = 0;
     if (!Container.isLoading)
         count = header.Nodes.Length;
     count = Container + count;
     if (Container.isLoading)
         header.Nodes = new HNodeStruct[count];
     for (int i = 0; i < count; i++)
     {
         if (Container.isLoading)
             header.Nodes[i] = new HNodeStruct();
         HNodeStruct t = header.Nodes[i];
         t.unk1 = Container + t.unk1;
         t.unk2 = Container + t.unk2;
         t.Name = SerializeString(Container, t.Name);
         t.unk3 = Container + t.unk3;
         header.Nodes[i] = t;
     }
     count = 0;
     if (!Container.isLoading)
         count = header.Names.Length;
     count = Container + count;
     if (Container.isLoading)
         header.Names = new string[count];
     for (int i = 0; i < count; i++)
         header.Names[i] = SerializeString(Container, header.Names[i]);
 }
开发者ID:ME3Explorer,项目名称:ME3Explorer,代码行数:47,代码来源:ME3FaceFXAnimSet.cs

示例7: Serialize

 public void Serialize(SerializingContainer Container)
 {
     Position.X = Container + Position.X;
     Position.Y = Container + Position.Y;
     Position.Z = Container + Position.Z;
     TangentX = Container + TangentX;
     TangentY = Container + TangentY;
     TangentZ = Container + TangentZ;                
     if (Container.isLoading)
         UV = new Vector2[4];
     for (int i = 0; i < 4; i++)
     {
         UV[i].X = Container + UV[i].X;
         UV[i].Y = Container + UV[i].Y;
     }
     Color = Container + Color;
     Bone = Container + Bone;  
 }
开发者ID:ME3Explorer,项目名称:ME3Explorer,代码行数:18,代码来源:SkeletalMesh.cs

示例8: Serialize

 void Serialize(SerializingContainer Container)
 {
     SerializeHeader(Container);
     SerializeData(Container);
 }
开发者ID:ME3Explorer,项目名称:ME3Explorer,代码行数:5,代码来源:ME3FaceFXAnimSet.cs

示例9: DumpToFile

 public void DumpToFile(string path)
 {
     
     MemoryStream m = new MemoryStream();
     SerializingContainer Container = new SerializingContainer(m);
     Container.isLoading = false;
     Serialize(Container);
     m = Container.Memory;
     File.WriteAllBytes(path, m.ToArray());
 }
开发者ID:ME3Explorer,项目名称:ME3Explorer,代码行数:10,代码来源:ME3FaceFXAnimSet.cs

示例10: Save

 public void Save()
 {
     
     MemoryStream m = new MemoryStream();
     SerializingContainer Container = new SerializingContainer(m);
     Container.isLoading = false;
     Serialize(Container);
     m = Container.Memory;
     MemoryStream res = new MemoryStream();
     List<PropertyReader.Property> props = PropertyReader.getPropList(export);
     int start = props[props.Count - 1].offend;
     res.Write(export.Data, 0, start);
     res.WriteValueS32((int)m.Length);
     res.WriteStream(m);
     export.Data = res.ToArray();
 }
开发者ID:ME3Explorer,项目名称:ME3Explorer,代码行数:16,代码来源:ME3FaceFXAnimSet.cs

示例11: importLODToolStripMenuItem_Click


//.........这里部分代码省略.........
            lodpcc.IndexBuffer = new SkeletalMesh.MultiSizeIndexContainerStruct();
            lodpcc.IndexBuffer.IndexCount = lodudk.IndexBuffer.IndexCount;
            lodpcc.IndexBuffer.IndexSize = lodudk.IndexBuffer.IndexSize;
            lodpcc.IndexBuffer.Indexes = new List<ushort>();
            foreach (ushort Idx in lodudk.IndexBuffer.Indexes)
                lodpcc.IndexBuffer.Indexes.Add(Idx);
            List<int> BoneMap = new List<int>();
            for (int i = 0; i < skmudk.Bones.Count; i++)
            {
                string udkb = udk.GetName(skmudk.Bones[i].Name);
                bool found = false;
                for (int j = 0; j < skm.Bones.Count; j++)
                {
                    string pccb = pcc.getNameEntry(skm.Bones[j].Name);
                    if (pccb == udkb)
                    {
                        found = true;
                        BoneMap.Add(j);
                        if (importBonesToolStripMenuItem.Checked)
                        {
                            SkeletalMesh.BoneStruct bpcc = skm.Bones[j];
                            UDKExplorer.UDK.Classes.SkeletalMesh.BoneStruct budk = skmudk.Bones[i];
                            bpcc.Orientation = budk.Orientation;
                            bpcc.Position = budk.Position;
                            skm.Bones[j] = bpcc;
                        }
                    }
                }
                if (!found)
                {
                    DebugOutput.PrintLn("ERROR: Cant Match Bone \"" + udkb + "\"");
                    BoneMap.Add(0);
                }
            }

            lodpcc.ActiveBones = new List<ushort>();
            foreach (ushort Idx in lodudk.ActiveBones)
                lodpcc.ActiveBones.Add((ushort)BoneMap[Idx]);
            lodpcc.Chunks = new List<SkeletalMesh.SkelMeshChunkStruct>();
            foreach (UDKExplorer.UDK.Classes.SkeletalMesh.SkelMeshChunkStruct chunkudk in lodudk.Chunks)
            {
                SkeletalMesh.SkelMeshChunkStruct chunkpcc = new SkeletalMesh.SkelMeshChunkStruct();
                chunkpcc.BaseVertexIndex = chunkudk.BaseVertexIndex;
                chunkpcc.MaxBoneInfluences = chunkudk.MaxBoneInfluences;
                chunkpcc.NumRigidVertices = chunkudk.NumRigidVertices;
                chunkpcc.NumSoftVertices = chunkudk.NumSoftVertices;
                chunkpcc.BoneMap = new List<ushort>();
                chunkpcc.RiginSkinVertices = new List<SkeletalMesh.RigidSkinVertexStruct>();
                chunkpcc.SoftSkinVertices = new List<SkeletalMesh.SoftSkinVertexStruct>();
                foreach (ushort Idx in chunkudk.BoneMap)
                    chunkpcc.BoneMap.Add((ushort)BoneMap[Idx]);
                lodpcc.Chunks.Add(chunkpcc);
            }
            lodpcc.Size = lodudk.Size;
            lodpcc.NumVertices = lodudk.NumVertices;
            lodpcc.RequiredBones = new List<byte>();
            foreach (byte b in lodudk.RequiredBones)
                lodpcc.RequiredBones.Add(b);
            lodpcc.VertexBufferGPUSkin = new SkeletalMesh.VertexBufferGPUSkinStruct();
            lodpcc.VertexBufferGPUSkin.NumTexCoords = lodudk.VertexBufferGPUSkin.NumTexCoords;
            lodpcc.VertexBufferGPUSkin.Extension = lodudk.VertexBufferGPUSkin.Extension;
            lodpcc.VertexBufferGPUSkin.Origin = lodudk.VertexBufferGPUSkin.Origin;
            lodpcc.VertexBufferGPUSkin.VertexSize = lodudk.VertexBufferGPUSkin.VertexSize;
            lodpcc.VertexBufferGPUSkin.Vertices = new List<SkeletalMesh.GPUSkinVertexStruct>();
            foreach (UDKExplorer.UDK.Classes.SkeletalMesh.GPUSkinVertexStruct vudk in lodudk.VertexBufferGPUSkin.Vertices)
            {
                SkeletalMesh.GPUSkinVertexStruct vpcc = new SkeletalMesh.GPUSkinVertexStruct();
                vpcc.TangentX = vudk.TangentX;
                vpcc.TangentZ = vudk.TangentZ;
                vpcc.Position = vudk.Position;
                vpcc.InfluenceBones = vudk.InfluenceBones;
                vpcc.InfluenceWeights = vudk.InfluenceWeights;
                vpcc.U = vudk.U;
                vpcc.V = vudk.V;
                lodpcc.VertexBufferGPUSkin.Vertices.Add(vpcc);
            }
            for (int i = 0; i < skm.LODModels.Count; i++)
                skm.LODModels[i] = lodpcc;
            SerializingContainer con = new SerializingContainer();
            con.Memory = new MemoryStream();
            con.isLoading = false;
            skm.Serialize(con);
            int end = skm.GetPropertyEnd();
            MemoryStream mem = new MemoryStream();
            mem.Write(pcc.Exports[en.Index].Data, 0, end);
            mem.Write(con.Memory.ToArray(), 0, (int)con.Memory.Length);
            pcc.Exports[en.Index].Data = mem.ToArray();
            pcc.altSaveToFile(pcc.pccFileName, true);
            if (!en.isDLC)
                MessageBox.Show("Done");
            else
                MessageBox.Show("Done. The file is now in following folder, please replace it back to DLC :\n" + loc + "dlc.pcc");
            globalTreeToolStripMenuItem.Visible =
            optionsToolStripMenuItem.Visible =
            transferToolStripMenuItem.Visible =
            splitContainer1.Visible = true;
            fileToolStripMenuItem.Visible =
            importLODToolStripMenuItem.Visible =
            splitContainer3.Visible = false;
        }
开发者ID:CreeperLava,项目名称:ME3Explorer,代码行数:101,代码来源:Meshplorer2.cs

示例12: SerializeBones

 private void SerializeBones(SerializingContainer Container)
 {
     int count = 0;
     if (!Container.isLoading)
         count = Bones.Count();
     count = Container + count;
     if (Container.isLoading)
     {
         Bones = new List<BoneStruct>();
         for (int i = 0; i < count; i++)
             Bones.Add(new BoneStruct());
     }
     for (int i = 0; i < count; i++)
     {
         BoneStruct b = Bones[i];
         b.Name = Container + b.Name;
         b.Flags = Container + b.Flags;
         b.Unk1 = Container + b.Unk1;
         b.Orientation.X = Container + b.Orientation.X;
         b.Orientation.Y = Container + b.Orientation.Y;
         b.Orientation.Z = Container + b.Orientation.Z;
         b.Orientation.W = Container + b.Orientation.W;
         b.Position.X = Container + b.Position.X;
         b.Position.Y = Container + b.Position.Y;
         b.Position.Z = Container + b.Position.Z;
         b.NumChildren = Container + b.NumChildren;
         b.Parent = Container + b.Parent;
         b.BoneColor = Container + b.BoneColor;
         Bones[i] = b;
     }
     SkeletonDepth = Container + SkeletonDepth;
 }
开发者ID:ME3Explorer,项目名称:ME3Explorer,代码行数:32,代码来源:SkeletalMesh.cs

示例13: SerializeOrgRot

 private void SerializeOrgRot(SerializingContainer Container)
 {
     Origin.X = Container + Origin.X;
     Origin.Y = Container + Origin.Y;
     Origin.Z = Container + Origin.Z;
     Rotation.X = Container + Rotation.X;
     Rotation.Y = Container + Rotation.Y;
     Rotation.Z = Container + Rotation.Z;
     
 }
开发者ID:ME3Explorer,项目名称:ME3Explorer,代码行数:10,代码来源:SkeletalMesh.cs

示例14: SerializeMaterials

 private void SerializeMaterials(SerializingContainer Container)
 {
     int count = 0;
     if (!Container.isLoading)
         count = Materials.Count();
     count = Container + count;
     if (Container.isLoading)
     {
         Materials = new List<int>();
         for (int i = 0; i < count; i++)
             Materials.Add(0);
     }
     for (int i = 0; i < count; i++)
         Materials[i] = Container + Materials[i];
 }
开发者ID:ME3Explorer,项目名称:ME3Explorer,代码行数:15,代码来源:SkeletalMesh.cs

示例15: SerializeBoundings

 private void SerializeBoundings(SerializingContainer Container)
 {
     Bounding.origin.X = Container + Bounding.origin.X;
     Bounding.origin.Y = Container + Bounding.origin.Y;
     Bounding.origin.Z = Container + Bounding.origin.Z;
     Bounding.size.X = Container + Bounding.size.X;
     Bounding.size.Y = Container + Bounding.size.Y;
     Bounding.size.Z = Container + Bounding.size.Z;
     Bounding.r = Container + Bounding.r;
 }
开发者ID:ME3Explorer,项目名称:ME3Explorer,代码行数:10,代码来源:SkeletalMesh.cs


注:本文中的SerializingContainer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。