示例#1
0
 public void Add(TransformData t)
 {
     _Children.Add(t);
 }
示例#2
0
 public bool Remove(TransformData t)
 {
     return(_Children.Remove(t));
 }
示例#3
0
        public void Load(XmlElement e)
        {
            this.Name = e.GetAttributeValueAsString("TName", "Transform");

            XmlElement p  = e["Position"];
            XmlElement lp = e["LocalPosition"];
            XmlElement ls = e["LocalScale"];
            XmlElement r  = e["Rotation"];
            XmlElement lr = e["LocalRotation"];

            if (p != null)
            {
                _Position.Load(p);
            }
            if (lp != null)
            {
                _LocalPosition.Load(lp);
            }
            if (ls != null)
            {
                _LocalScale.Load(ls);
            }
            if (r != null)
            {
                _Rotation.Load(r);
            }
            if (lr != null)
            {
                _LocalRotation.Load(lr);
            }


            XmlElement rt = e["RectTransform"];

            if (rt != null)
            {
                if (_RectTransform == null)
                {
                    _RectTransform = new RectTransformData(this);
                }
                _RectTransform.Load(rt);
            }


            _Children.Clear();
            XmlElement children = e["Children"];

            if (children != null)
            {
                int count = children.GetAttributeValueAsInt("Count", 0);
                if (count > 0)
                {
                    this._Children.Capacity = count;
                    foreach (var element in children)
                    {
                        TransformData t = new TransformData();
                        t.Load(element);
                        _Children.Add(t);
                    }
                }
            }
        }