本文整理汇总了C#中AnimatTools.FindChildByIndex方法的典型用法代码示例。如果您正苦于以下问题:C# AnimatTools.FindChildByIndex方法的具体用法?C# AnimatTools.FindChildByIndex怎么用?C# AnimatTools.FindChildByIndex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AnimatTools
的用法示例。
在下文中一共展示了AnimatTools.FindChildByIndex方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadData
public override void LoadData(ref AnimatTools.DataObjects.Simulation dsSim, ref AnimatTools.DataObjects.Physical.PhysicalStructure doStructure, ref AnimatTools.Interfaces.StdXml oXml)
{
m_aryChildBodies.Clear();
oXml.IntoElem(); //'Into RigidBody Element
m_strID = oXml.GetChildString("ID");
m_strName = oXml.GetChildString("Name", m_strID);
m_strDescription = oXml.GetChildString("Description", "");
if(m_strName.Trim().Length == 0)
m_strName = m_strID;
if(oXml.FindChildElement("Color", false))
{
System.Drawing.Color oColor = Util.LoadColor(ref oXml, "Color");
this.Alpha = oColor.A;
this.Color = oColor;
}
if(oXml.FindChildElement("MuscleAttachments", false))
{
oXml.IntoElem();
oXml.AddChildElement("Description", m_strDescription);
if(oXml.NumberOfChildren() > 2)
throw new System.Exception("The standard spring can not have more than 2 attachment points.");
else if(oXml.NumberOfChildren() == 2)
{
oXml.FindChildByIndex(0);
m_strPrimaryAttachID = oXml.GetChildString();
oXml.FindChildByIndex(1);
m_strSecondaryAttachID = oXml.GetChildString();
}
else if(oXml.NumberOfChildren() == 1)
{
oXml.FindChildByIndex(0);
m_strPrimaryAttachID = oXml.GetChildString();
}
else
{
m_strPrimaryAttachID = "";
m_strSecondaryAttachID = "";
}
oXml.OutOfElem();
}
else
{
if(oXml.FindChildElement("PrimaryAttachmentID", false))
m_strPrimaryAttachID = oXml.GetChildString("PrimaryAttachmentID");
if(oXml.FindChildElement("SecondaryAttachmentID", false))
m_strSecondaryAttachID = oXml.GetChildString("SecondaryAttachmentID");
}
m_snNaturalLength.LoadData(ref oXml, "NaturalLength");
m_snStiffness.LoadData(ref oXml, "Stiffness");
m_snDamping.LoadData(ref oXml, "Damping");
m_bEnabled = oXml.GetChildBool("Enabled", m_bEnabled);
m_bVisible = oXml.GetChildBool("IsVisible", m_bVisible);
oXml.OutOfElem(); //Outof RigidBody Element
}