Ejemplo n.º 1
0
        XmlBoneKeyFrame[] ParseBoneData(XmlReader xml)
        {
            Dictionary <int, XmlBoneKeyFrame> frames = new Dictionary <int, XmlBoneKeyFrame>();

            int subDepth = xml.Depth;

            while (xml.Read() && xml.Depth > subDepth)
            {
                if (xml.IsStartElement() && !xml.IsEmptyElement)
                {
                    switch (xml.Name)
                    {
                    case "Position":
                        ParseBonePosition(xml, frames);
                        break;

                    case "Quaternion":
                        ParseBoneRotation(xml, frames);
                        break;

                    case "Scale":
                        ParseBoneScale(xml, frames);
                        break;
                    }
                }
            }

            Dictionary <int, XmlBoneKeyFrame> .ValueCollection vals = frames.Values;
            XmlBoneKeyFrame[] frameArray = new XmlBoneKeyFrame[frames.Count];

            int index = 0;

            foreach (XmlBoneKeyFrame f in vals)
            {
                frameArray[index++] = f;
            }
            return(frameArray);
        }
Ejemplo n.º 2
0
        XmlBoneKeyFrame[] ParseBoneData(XmlReader xml)
        {
            Dictionary<int, XmlBoneKeyFrame> frames = new Dictionary<int, XmlBoneKeyFrame>();

            int subDepth = xml.Depth;
            while (xml.Read() && xml.Depth > subDepth)
            {
                if (xml.IsStartElement() && !xml.IsEmptyElement)
                {
                    switch (xml.Name)
                    {
                        case "Position":
                            ParseBonePosition(xml, frames);
                            break;
                        case "Quaternion":
                            ParseBoneRotation(xml, frames);
                            break;
                        case "Scale":
                            ParseBoneScale(xml, frames);
                            break;
                    }
                }
            }

            Dictionary<int, XmlBoneKeyFrame>.ValueCollection vals = frames.Values;
            XmlBoneKeyFrame[] frameArray = new XmlBoneKeyFrame[frames.Count];

            int index = 0;
            foreach (XmlBoneKeyFrame f in vals)
            {
                frameArray[index++] = f;
            }
            return frameArray;
        }