public override void Read(string rootName, XmlDocument xml) { string str = rootName + "/" + this.elementName + "/"; foreach (FieldInfo fieldInfo in this.FieldInfos) { XmlNodeList xmlNodeList = xml.SelectNodes(str + fieldInfo.Name); if (xmlNodeList != null && xmlNodeList.Item(0) is XmlElement xmlElement) { fieldInfo.SetValue((object)this, BaseSystem.Cast(xmlElement.InnerText, fieldInfo.FieldType)); } } }
public override void Read(string rootName, XmlDocument xml) { try { string str = rootName + "/" + this.elementName + "/"; XmlNodeList xmlNodeList1 = xml.SelectNodes(str + "SelfShadow"); if (xmlNodeList1 != null && xmlNodeList1.Item(0) is XmlElement xmlElement) { this.SelfShadow = (bool)BaseSystem.Cast(xmlElement.InnerText, this.SelfShadow.GetType()); } XmlNodeList xmlNodeList2 = xml.SelectNodes(str + "Bloom"); if (xmlNodeList2 != null && xmlNodeList2.Item(0) is XmlElement xmlElement) { this.Bloom = (bool)BaseSystem.Cast(xmlElement.InnerText, this.Bloom.GetType()); } XmlNodeList xmlNodeList3 = xml.SelectNodes(str + "SSAO"); if (xmlNodeList3 != null && xmlNodeList3.Item(0) is XmlElement xmlElement) { this.SSAO = (bool)BaseSystem.Cast(xmlElement.InnerText, this.SSAO.GetType()); } XmlNodeList xmlNodeList4 = xml.SelectNodes(str + "SSR"); if (xmlNodeList4 != null && xmlNodeList4.Item(0) is XmlElement xmlElement) { this.SSR = (bool)BaseSystem.Cast(xmlElement.InnerText, this.SSR.GetType()); } XmlNodeList xmlNodeList5 = xml.SelectNodes(str + "DepthOfField"); if (xmlNodeList5 != null && xmlNodeList5.Item(0) is XmlElement xmlElement) { this.DepthOfField = (bool)BaseSystem.Cast(xmlElement.InnerText, this.DepthOfField.GetType()); } XmlNodeList xmlNodeList6 = xml.SelectNodes(str + "Atmospheric"); if (xmlNodeList6 != null && xmlNodeList6.Item(0) is XmlElement xmlElement) { this.Atmospheric = (bool)BaseSystem.Cast(xmlElement.InnerText, this.Atmospheric.GetType()); } XmlNodeList xmlNodeList7 = xml.SelectNodes(str + "Vignette"); if (xmlNodeList7 != null && xmlNodeList7.Item(0) is XmlElement xmlElement) { this.Vignette = (bool)BaseSystem.Cast(xmlElement.InnerText, this.Vignette.GetType()); } XmlNodeList xmlNodeList8 = xml.SelectNodes(str + "Rain"); if (xmlNodeList8 != null && xmlNodeList8.Item(0) is XmlElement xmlElement) { this.Rain = (bool)BaseSystem.Cast(xmlElement.InnerText, this.Rain.GetType()); } XmlNodeList xmlNodeList9 = xml.SelectNodes(str + "CharaGraphicQuality"); if (xmlNodeList9 != null && xmlNodeList9.Item(0) is XmlElement xmlElement) { this.CharaGraphicQuality = (byte)BaseSystem.Cast(xmlElement.InnerText, this.CharaGraphicQuality.GetType()); } XmlNodeList xmlNodeList10 = xml.SelectNodes(str + "MapGraphicQuality"); if (xmlNodeList10 != null && xmlNodeList10.Item(0) is XmlElement xmlElement) { this.MapGraphicQuality = (byte)BaseSystem.Cast(xmlElement.InnerText, this.MapGraphicQuality.GetType()); } XmlNodeList xmlNodeList11 = xml.SelectNodes(str + "FaceLight"); if (xmlNodeList11 != null && xmlNodeList11.Item(0) is XmlElement xmlElement) { this.FaceLight = (bool)BaseSystem.Cast(xmlElement.InnerText, this.FaceLight.GetType()); } XmlNodeList xmlNodeList12 = xml.SelectNodes(str + "AmbientLight"); if (xmlNodeList12 != null && xmlNodeList12.Item(0) is XmlElement xmlElement) { this.AmbientLight = (bool)BaseSystem.Cast(xmlElement.InnerText, this.AmbientLight.GetType()); } XmlNodeList xmlNodeList13 = xml.SelectNodes(str + "Shield"); if (xmlNodeList13 != null && xmlNodeList13.Item(0) is XmlElement xmlElement) { this.Shield = (bool)BaseSystem.Cast(xmlElement.InnerText, this.Shield.GetType()); } XmlNodeList xmlNodeList14 = xml.SelectNodes(str + "SimpleBody"); if (xmlNodeList14 != null && xmlNodeList14.Item(0) is XmlElement xmlElement) { this.SimpleBody = (bool)BaseSystem.Cast(xmlElement.InnerText, this.SimpleBody.GetType()); } XmlNodeList xmlNodeList15 = xml.SelectNodes(str + "SilhouetteColor"); if (xmlNodeList15 != null && xmlNodeList15.Item(0) is XmlElement xmlElement) { this.SilhouetteColor = (Color)BaseSystem.Cast(xmlElement.InnerText, this.SilhouetteColor.GetType()); } XmlNodeList xmlNodeList16 = xml.SelectNodes(str + "BackColor"); if (xmlNodeList16 != null && xmlNodeList16.Item(0) is XmlElement xmlElement) { this.BackColor = (Color)BaseSystem.Cast(xmlElement.InnerText, this.BackColor.GetType()); } XmlNodeList xmlNodeList17 = xml.SelectNodes(str + "MaxCharaNum"); if (xmlNodeList17 != null && xmlNodeList17.Item(0) is XmlElement xmlElement) { this.MaxCharaNum = (int)BaseSystem.Cast(xmlElement.InnerText, this.MaxCharaNum.GetType()); } for (int index = 0; index < 4; ++index) { XmlNodeList xmlNodeList18 = xml.SelectNodes(str + "CharasEntry" + (object)index); if (xmlNodeList18 != null && xmlNodeList18.Item(0) is XmlElement xmlElement) { this.CharasEntry[index] = (bool)BaseSystem.Cast(xmlElement.InnerText, this.CharasEntry[index].GetType()); } } } catch (Exception ex) { Debug.LogError((object)ex.Message); } }