示例#1
0
        public static void SaveXmlPrefab(this GUINode e, string path)
        {
            XmlDocument doc = new XmlDocument();
            XmlElement  ele = doc.CreateElement("Element_Prefab");

            ele.SetAttribute("Type", e.GetType().Name);
            ele.AppendChild(e.Serialize(doc));
            doc.AppendChild(ele);
            doc.Save(path);
        }
        private void EleGUI(GUINode ele)
        {
            GUINodeEditor des = dic[ele.GetType()];

            des.element = ele;
            des.OnSceneGUI(() => {
                for (int i = 0; i < ele.Children.Count; i++)
                {
                    EleGUI(ele.Children[i] as GUINode);
                }
            });
        }
示例#3
0
 protected GUINode(GUINode other)
 {
     m_name          = other.m_name;
     m_enable        = other.m_enable;
     m_active        = other.m_active;
     rotateAngle     = other.rotateAngle;
     rotateOffset    = other.rotateOffset;
     color           = other.color;
     contentColor    = other.contentColor;
     backgroundColor = other.backgroundColor;
     this.calculator = new RectCalculator(other.calculator);
     for (int i = 0; i < other.children.Count; i++)
     {
         GUINode element = other.children[i] as GUINode;
         GUINode copy    = Activator.CreateInstance(element.GetType(), other.children[i]) as GUINode;
         copy.parent = this;
     }
 }