示例#1
0
        public void Load(XmlElement e)
        {
            foreach (var item in e)
            {
                if (item.Name == "XKeys")
                {
                    XmlElement keys = item[KeyframeDataCollection.ElementName];
                    if (keys != null)
                    {
                        XKeys.Load(keys);
                    }
                }
                else if (item.Name == "YKeys")
                {
                    XmlElement keys = item[KeyframeDataCollection.ElementName];
                    if (keys != null)
                    {
                        YKeys.Load(keys);
                    }
                }
                else if (item.Name == "ZKeys")
                {
                    XmlElement keys = item[KeyframeDataCollection.ElementName];
                    if (keys != null)
                    {
                        ZKeys.Load(keys);
                    }
                }


                if (item.Name == "RXKeys")
                {
                    XmlElement keys = item[KeyframeDataCollection.ElementName];
                    if (keys != null)
                    {
                        RXKeys.Load(keys);
                    }
                }
                else if (item.Name == "RYKeys")
                {
                    XmlElement keys = item[KeyframeDataCollection.ElementName];
                    if (keys != null)
                    {
                        RYKeys.Load(keys);
                    }
                }
                else if (item.Name == "RZKeys")
                {
                    XmlElement keys = item[KeyframeDataCollection.ElementName];
                    if (keys != null)
                    {
                        RZKeys.Load(keys);
                    }
                }
            }
        }
示例#2
0
        public XmlElement ToXmlElement()
        {
            XmlElement rootMotion = new XmlElement(ElementName);

            if (XKeys.Count > 0)
            {
                XmlElement xKeys = new XmlElement("XKeys");
                xKeys.AppendChild(XKeys.ToXmlElement());
                rootMotion.AppendChild(xKeys);
            }
            if (YKeys.Count > 0)
            {
                XmlElement yKeys = new XmlElement("YKeys");
                yKeys.AppendChild(YKeys.ToXmlElement());
                rootMotion.AppendChild(yKeys);
            }

            if (ZKeys.Count > 0)
            {
                XmlElement zKeys = new XmlElement("ZKeys");
                zKeys.AppendChild(ZKeys.ToXmlElement());
                rootMotion.AppendChild(zKeys);
            }

            if (RXKeys.Count > 0)
            {
                XmlElement rxKeys = new XmlElement("RXKeys");
                rxKeys.AppendChild(RXKeys.ToXmlElement());
                rootMotion.AppendChild(rxKeys);
            }

            if (RYKeys.Count > 0)
            {
                XmlElement ryKeys = new XmlElement("RYKeys");
                ryKeys.AppendChild(RYKeys.ToXmlElement());
                rootMotion.AppendChild(ryKeys);
            }

            if (RZKeys.Count > 0)
            {
                XmlElement rzKeys = new XmlElement("RZKeys");
                rzKeys.AppendChild(RZKeys.ToXmlElement());
                rootMotion.AppendChild(rzKeys);
            }

            return(rootMotion);
        }