public void deserializePanelRoot(XmlElement ele) { this.Field = ele.GetAttribute("field"); this.FilePath = ele.GetAttribute("filePath"); this.LuaRequirePath = ele.GetAttribute("luaRequirePath"); if (string.IsNullOrEmpty(this.LuaRequirePath)) { this.LuaRequirePath = this.FilePath.Replace(".lua", string.Empty).Replace("/", "."); } foreach (XmlElement xmlElement in ele.ChildNodes) { string text = xmlElement.GetAttribute("hierarchy"); text = text.Replace(".", "/"); Transform transform = base.transform.FindChild(text); if (!(transform == null)) { UIGenFlag uIGenFlag = transform.GetComponent <UIGenFlag>(); if (uIGenFlag == null) { uIGenFlag = transform.gameObject.AddComponent <UIGenFlag>(); } uIGenFlag.deserializeFlag(xmlElement); } } }
/// <summary> /// 反序列化记录数据 /// </summary> /// <param name="doc"></param> public void deserializePanelRoot(XmlElement ele) { this.Field = ele.GetAttribute("field"); this.FilePath = ele.GetAttribute("filePath"); this.LuaRequirePath = ele.GetAttribute("luaRequirePath"); if (string.IsNullOrEmpty(LuaRequirePath)) { LuaRequirePath = this.FilePath.Replace(".lua", "").Replace("/", "."); } // this.Controller = ele.GetAttribute("ctrlName"); foreach (XmlElement childEle in ele.ChildNodes) { string hierarchy = childEle.GetAttribute("hierarchy"); hierarchy = hierarchy.Replace(".", "/"); Transform trans = this.transform.Find(hierarchy); if (trans == null) { continue; } UIGenFlag flag = trans.GetComponent <UIGenFlag>(); if (flag == null) { flag = trans.gameObject.AddComponent <UIGenFlag>(); } flag.deserializeFlag(childEle); } }