コード例 #1
0
        public override XmlElement VToXML()
        {
            var componentDoc       = new XmlDocument();
            var componentData      = componentDoc.CreateElement(GetComponentName <Cv_TransformAnimationComponent>());
            var transformAnimation = componentDoc.CreateElement("TransformAnimation");
            var onEndScript        = componentDoc.CreateElement("OnEndScript");
            var paused             = componentDoc.CreateElement("Paused");
            var looping            = componentDoc.CreateElement("Looping");
            var resetOnEnd         = componentDoc.CreateElement("ResetOnEnd");

            transformAnimation.SetAttribute("resource", TransformAnimation);
            onEndScript.SetAttribute("resource", OnEndScript);
            paused.SetAttribute("status", Paused.ToString(CultureInfo.InvariantCulture));
            looping.SetAttribute("status", Looping.ToString(CultureInfo.InvariantCulture));
            resetOnEnd.SetAttribute("status", ResetOnEnd.ToString(CultureInfo.InvariantCulture));

            componentData.AppendChild(transformAnimation);
            componentData.AppendChild(onEndScript);
            componentData.AppendChild(paused);
            componentData.AppendChild(looping);
            componentData.AppendChild(resetOnEnd);

            return(componentData);
        }