本文整理汇总了C#中System.Xml.XmlWriter.WriteVector方法的典型用法代码示例。如果您正苦于以下问题:C# XmlWriter.WriteVector方法的具体用法?C# XmlWriter.WriteVector怎么用?C# XmlWriter.WriteVector使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.XmlWriter
的用法示例。
在下文中一共展示了XmlWriter.WriteVector方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadPhysics
void ReadPhysics(string pText)
{
switch (pText)
{
case "Physics":
string fileName = $"Physics_{PhysicsCount}.xml";
xw = XmlWriter.Create(Path.Combine(Folder, fileName), xws);
filelist.Add(fileName);
PhysicsCount++;
xw.WriteStartDocument();
xw.WriteStartElement("Physics");
break;
case "SizeRatio":
xw.WriteStartElement("SizeRatio");
xw.WriteAttributeString("Value", br.ReadSingle());
xw.WriteEndElement();
break;
case "Gravity":
xw.WriteStartElement("Gravity");
xw.WriteAttributeString("Value", br.ReadSingle());
xw.WriteEndElement();
break;
case "RigidBody":
xw.WriteStartElement("RigidBody");
xw.WriteAttributeString("Count", br.ReadInt32());
xw.WriteEndElement();
break;
case "Name":
xw.WriteStartElement("Name");
xw.WriteAttributeString("Text", ReadText());
break;
case "BoneIdx":
xw.WriteStartElement("BoneIdx");
xw.WriteAttributeString("Value", br.ReadInt32());
xw.WriteEndElement();
break;
case "GroupNo":
xw.WriteStartElement("GroupNo");
xw.WriteAttributeString("Value", br.ReadByte());
xw.WriteEndElement();
break;
case "UnCollisionGroup":
xw.WriteStartElement("UnCollisionGroup");
xw.WriteAttributeString("Value", br.ReadInt16());
xw.WriteEndElement();
break;
case "Shape":
xw.WriteStartElement("Shape");
xw.WriteAttributeString("Value", br.ReadByte());
xw.WriteEndElement();
break;
case "Size":
xw.WriteStartElement("Size");
xw.WriteVector(br.ReadSingle(), br.ReadSingle(), br.ReadSingle());
xw.WriteEndElement();
break;
case "Pos":
xw.WriteStartElement("Pos");
xw.WriteVector(br.ReadSingle(), br.ReadSingle(), br.ReadSingle());
xw.WriteEndElement();
break;
case "Rota":
xw.WriteStartElement("Rota");
xw.WriteVector(br.ReadSingle(), br.ReadSingle(), br.ReadSingle());
xw.WriteEndElement();
break;
case "Mass":
xw.WriteStartElement("Mass");
xw.WriteAttributeString("Value", br.ReadSingle());
xw.WriteEndElement();
break;
case "MoveAtte":
xw.WriteStartElement("MoveAtte");
xw.WriteAttributeString("Value", br.ReadSingle());
xw.WriteEndElement();
break;
case "RotaAtte":
xw.WriteStartElement("RotaAtte");
xw.WriteAttributeString("Value", br.ReadSingle());
xw.WriteEndElement();
break;
case "Repulsion":
xw.WriteStartElement("Repulsion");
xw.WriteAttributeString("Value", br.ReadSingle());
xw.WriteEndElement();
break;
case "Fric":
xw.WriteStartElement("Fric");
xw.WriteAttributeString("Value", br.ReadSingle());
xw.WriteEndElement();
break;
case "CalcType":
xw.WriteStartElement("CalcType");
xw.WriteAttributeString("Value", br.ReadByte());
xw.WriteEndElement();
break;
case "EndRigid":
xw.WriteEndElement();
break;
case "Joint":
//.........这里部分代码省略.........
示例2: ReadAnimation
void ReadAnimation(string ptext)
{
switch (ptext)
{
case "AnimeName":
string fileName = $"Anime_{AnimeCount}.xml";
xw = XmlWriter.Create(Path.Combine(Folder, fileName), xws);
filelist.Add(fileName);
AnimeCount++;
xw.WriteStartDocument();
xw.WriteStartElement("AnimeName");
xw.WriteAttributeString("Name", ReadText());
xw.WriteAttributeString("ID", br.ReadInt32());
break;
case "Windom_TopScript":
xw.WriteStartElement("Windom_TopScript");
xw.WriteString(ReadText());
xw.WriteEndElement();
break;
case "ScriptKey":
xw.WriteStartElement("ScriptKey");
xw.WriteAttributeString("Count", br.ReadInt32());
xw.WriteEndElement();
break;
case "Time":
xw.WriteStartElement("Time");
xw.WriteAttributeString("Value", br.ReadInt32());
break;
case "ScriptText":
xw.WriteStartElement("ScriptText");
xw.WriteString(ReadText());
xw.WriteEndElement();
break;
case "End":
xw.WriteEndElement();
break;
case "BoneData":
xw.WriteStartElement("BoneData");
break;
case "BoneName":
if (lastbone != "")
xw.WriteEndElement();
xw.WriteStartElement("BoneName");
lastbone = ReadText();
xw.WriteAttributeString("Text", lastbone);
break;
case "CalcType":
xw.WriteStartElement("CalcType");
xw.WriteAttributeString("Value", br.ReadByte());
xw.WriteEndElement();
break;
case "PowVal":
xw.WriteStartElement("PowVal");
xw.WriteAttributeString("Value", br.ReadSingle());
xw.WriteEndElement();
break;
case "Pos":
xw.WriteStartElement("Pos");
xw.WriteVector(br.ReadSingle(), br.ReadSingle(), br.ReadSingle());
xw.WriteEndElement();
break;
case "PosKey":
xw.WriteStartElement("PosKey");
xw.WriteAttributeString("Count", br.ReadInt32());
xw.WriteEndElement();
break;
case "Rota":
xw.WriteStartElement("Rota");
xw.WriteVector(br.ReadSingle(), br.ReadSingle(), br.ReadSingle(), br.ReadSingle());
xw.WriteEndElement();
break;
case "RotateKey":
xw.WriteStartElement("RotateKey");
xw.WriteAttributeString("Count", br.ReadInt32());
xw.WriteEndElement();
break;
case "Scale":
xw.WriteStartElement("Scale");
xw.WriteVector(br.ReadSingle(), br.ReadSingle(), br.ReadSingle());
xw.WriteEndElement();
break;
case "ScaleKey":
xw.WriteStartElement("ScaleKey");
xw.WriteAttributeString("Count", br.ReadInt32());
xw.WriteEndElement();
break;
}
}