예제 #1
0
        public XmlElement ToXmlElement()
        {
            XmlElement p = new XmlElement("Plane");

            p.SetAttributeValue("Distance", Distance);
            p.AppendChild(Normal.ToXmlElement());
            return(p);
        }
예제 #2
0
        public XmlElement ToXmlElement()
        {
            XmlElement p = new XmlElement("Bounds");

            XmlElement center = Center.ToXmlElement();
            XmlElement size   = Size.ToXmlElement();

            center.SetAttributeValue("Name", "Center");
            size.SetAttributeValue("Name", "Size");

            p.AppendChild(center);
            p.AppendChild(size);
            return(p);
        }
예제 #3
0
        public XmlElement ToXmlElement()
        {
            XmlElement p = new XmlElement("Ray");

            XmlElement direction = Direction.ToXmlElement();
            XmlElement origin    = Origin.ToXmlElement();

            direction.SetAttributeValue("Name", "Direction");
            origin.SetAttributeValue("Name", "Origin");

            p.AppendChild(direction);
            p.AppendChild(origin);
            return(p);
        }
예제 #4
0
        public XmlElement ToXmlElement()
        {
            XmlElement t = new XmlElement("Transform");

            if (Name == null)
            {
                Name = string.Empty;
            }
            t.SetAttributeValue("TName", Name);

            XmlElement p  = _Position.ToXmlElement(); p.Name = "Position";
            XmlElement lp = _LocalPosition.ToXmlElement(); lp.Name = "LocalPosition";
            XmlElement ls = _LocalScale.ToXmlElement(); ls.Name = "LocalScale";
            XmlElement r  = _Rotation.ToXmlElement(); r.Name = "Rotation";
            XmlElement lr = _LocalRotation.ToXmlElement(); lr.Name = "LocalRotation";

            t.AppendChild(p);
            t.AppendChild(lp);
            t.AppendChild(ls);
            t.AppendChild(r);
            t.AppendChild(lr);

            if (_RectTransform != null)
            {
                t.AppendChild(_RectTransform.ToXmlElement());
            }


            if (this._Children.Count > 0)
            {
                XmlElement children = new XmlElement("Children");
                children.SetAttributeValue("Count", this._Children.Count);
                foreach (var item in this._Children)
                {
                    children.AppendChild(item.ToXmlElement());
                }
                t.AppendChild(children);
            }


            return(t);
        }