• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# SerializingContainer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: SerializeRawTriangles

 private void SerializeRawTriangles(SerializingContainer Container)
 {
     int size = 8;
     int count = 0;
     if (!Container.isLoading)
         count = RawTriangles.Length;
     size = Container + size;
     count = Container + count;
     if (Container.isLoading)
         RawTriangles = new Face[count];
     for (int i = 0; i < RawTriangles.Length; i++)
         RawTriangles[i].Serialize(Container);
 }
开发者ID:CreeperLava,项目名称:ME3Explorer,代码行数:13,代码来源:StaticMesh.cs


示例17: SerializeMinMax

 private void SerializeMinMax(SerializingContainer Container)
 {
     Min = Container + Min;
     Max = Container + Max;
 }
开发者ID:CreeperLava,项目名称:ME3Explorer,代码行数:5,代码来源:StaticMesh.cs


示例18: SerializeString

 string SerializeString(SerializingContainer Container, string s)
 {
     int len = 0;
     byte t = 0;
     if (Container.isLoading)
     {
         s = "";
         len = Container + len;
         for (int i = 0; i < len; i++)
             s += (char)(Container + (byte)0);
     }
     else
     {
         len = s.Length;
         len = Container + len;
         foreach (char c in s)
             t = Container + (byte)c;
     }
     return s;
 }
开发者ID:ME3Explorer,项目名称:ME3Explorer,代码行数:20,代码来源:ME3FaceFXAnimSet.cs


示例19: SerializeLODs

 private void SerializeLODs(SerializingContainer Container)
 {
     int count = 0;
     if (!Container.isLoading)
         count = LODModels.Count();
     count = Container + count;
     if (Container.isLoading)
     {
         LODModels = new List<LODModelStruct>();
         for (int i = 0; i < count; i++)
             LODModels.Add(new LODModelStruct());
     }
     for (int i = 0; i < count; i++)
     {
         LODModelStruct lod = LODModels[i];
         lod.Serialize(Container);
         LODModels[i] = lod;
     }
     //ReadEnd = Container.GetPos();
 }
开发者ID:ME3Explorer,项目名称:ME3Explorer,代码行数:20,代码来源:SkeletalMesh.cs


示例20: SerializekDOPTree

 private void SerializekDOPTree(SerializingContainer Container)
 {
     int size = 0;
     int count = 0;
     if (!Container.isLoading)
     {
         size = kDOPTree[0].Length;
         count = kDOPTree.Count;
     }
     size = Container + size;
     count = Container + count;
     if (Container.isLoading)
         kDOPTree = new List<byte[]>();
     for (int i = 0; i < count; i++)
     {
         if (Container.isLoading)
             kDOPTree.Add(new byte[size]);
         for (int j = 0; j < size; j++)
         {
             byte[] temp = kDOPTree[i];
             temp[j] = Container + temp[j];
             kDOPTree[i] = temp;
         }
     }
 }
开发者ID:CreeperLava,项目名称:ME3Explorer,代码行数:25,代码来源:StaticMesh.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Series类代码示例发布时间:2022-05-24
下一篇:
C# SerializerSession类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap